url
stringlengths
36
137
content
stringlengths
1.21k
7.75M
https://www.mongodb.com/docs/manual/reference/command/applyOps/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> applyOps <a class="headerlink leafygreen-ui-1kepx47" href="#applyops" 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="applyops"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#required-access" target="_self"> <span> Required Access </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> applyOps </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.applyOps" 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-dbcommand-dbcmd.applyOps"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Applies specified <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> entries to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance. The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.applyOps" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> applyOps </code> </span> </a> command is an internal command. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <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 command is not supported in serverless instances. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command obtains a global write lock and will block other operations until it has completed. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Required Access <a class="headerlink leafygreen-ui-1kepx47" href="#required-access" 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="required-access"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If the specified <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> entries contain <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/databases-and-collections/#std-label-collections-uuids"> collection UUIDs </a> , executing this command requires both the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-useUUID"> <code class="leafygreen-ui-1l06pbn"> useUUID </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-forceUUID"> <code class="leafygreen-ui-1l06pbn"> forceUUID </code> </a> privileges on the cluster resource to which the oplog entries are attempting to be written. </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/ObjectId.createFromBase64/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> ObjectId.createFromBase64() <a class="headerlink leafygreen-ui-1kepx47" href="#objectid.createfrombase64--" 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="objectid.createfrombase64--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Creates an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-ObjectId"> ObjectId </a> from a base64 value. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> ObjectId.createFromBase64( &lt;base64String&gt; [ , &lt;subType&gt; ] ) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-ObjectId.createFromBase64" 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-method-ObjectId.createFromBase64"> </div> </a> </dt> <dd> </dd> </dl> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Method Fields <a class="headerlink leafygreen-ui-1kepx47" href="#method-fields" 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="method-fields"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The method accepts the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> base64String </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> String </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies a 16 character base64 value. For example, <code class="leafygreen-ui-1l06pbn"> "SGVsbG8gV29ybGQh" </code> . </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> subType </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Specifies a binary subtype. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:40%"/> <col style="width:60%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 0 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Generic binary subtype </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 1 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Function </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 2 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Byte array (deprecated) </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 3 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Old UUID (deprecated) </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 4 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UUID </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MD5 </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 128 through 255 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> User defined </div> </div> </td> </tr> </tbody> </table> </div> </div> </div> </td> </tr> </tbody> </table> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following examples show how to add an object identifier to a document using <code class="leafygreen-ui-1l06pbn"> ObjectId.createFromBase64() </code> and how the object identifier appears in the output when retrieved. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create Collection Containing Document with Base64 Number <a class="headerlink leafygreen-ui-1kepx47" href="#create-collection-containing-document-with-base64-number" 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-collection-containing-document-with-base64-number"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example creates a collection named <code class="leafygreen-ui-1l06pbn"> objectIdentifierValuesFromBase64 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.objectIdentifierValuesFromBase64.insertOne( {\n _id: 0,\n objectIdentifierValue: ObjectId.createFromBase64( \"SGVsbG8gV29ybGQh\" )\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">objectIdentifierValuesFromBase64</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">objectIdentifierValue</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>.<span class="lg-highlight-title lg-highlight-function">createFromBase64</span>( <span class="lg-highlight-string">"SGVsbG8gV29ybGQh"</span> )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> objectIdentifierValue </code> field contains the object identifier created from the base64 string specified in <code class="leafygreen-ui-1l06pbn"> ObjectId.createFromBase64() </code> . </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Retrieve Document from Collection with Object Identifier <a class="headerlink leafygreen-ui-1kepx47" href="#retrieve-document-from-collection-with-object-identifier" 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="retrieve-document-from-collection-with-object-identifier"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example retrieves the document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.objectIdentifierValuesFromBase64.findOne( { _id: 0 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">objectIdentifierValuesFromBase64</span>.<span class="lg-highlight-title lg-highlight-function">findOne</span>( <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</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"> Example output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: 0,\n objectIdentifierValue: ObjectId(\"48656c6c6f20576f726c6421\")\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">objectIdentifierValue</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"48656c6c6f20576f726c6421"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/manage-chained-replication/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Self-Managed Chained Replication <a class="headerlink leafygreen-ui-1kepx47" href="#self-managed-chained-replication" 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="self-managed-chained-replication"> </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="#disable-chained-replication" target="_self"> <span> Disable Chained Replication </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#re-enable-chained-replication" target="_self"> <span> Re-enable Chained Replication </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> Starting in version 2.0, MongoDB supports chained replication. A chained replication occurs when a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondary </a> member replicates from another secondary member instead of from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> . This might be the case, for example, if a secondary selects its replication source based on ping time and if the closest member is another secondary. The replication source for the operation is the member from which the data is read. </p> <p class="leafygreen-ui-1kp3ins"> Chained replication can reduce load on the primary. But chained replication can also result in increased replication lag, depending on the topology of the network. </p> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.settings.chainingAllowed"> <code class="leafygreen-ui-1l06pbn"> settings.chainingAllowed </code> </a> setting in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/"> Self-Managed Replica Set Configuration </a> to disable chained replication for situations where chained replication is causing lag. </p> <p class="leafygreen-ui-1kp3ins"> MongoDB enables chained replication by default. This procedure describes how to disable it and how to re-enable it. </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"> If chained replication is disabled, you still can use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetSyncFrom/#mongodb-dbcommand-dbcmd.replSetSyncFrom"> <code class="leafygreen-ui-1l06pbn"> replSetSyncFrom </code> </a> to specify that a secondary replicates from another secondary. But that configuration will last only until the secondary recalculates which member to sync from. </p> </div> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Disable Chained Replication <a class="headerlink leafygreen-ui-1kepx47" href="#disable-chained-replication" 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="disable-chained-replication"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To disable chained replication, set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.settings.chainingAllowed"> <code class="leafygreen-ui-1l06pbn"> settings.chainingAllowed </code> </a> field in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/"> Self-Managed Replica Set Configuration </a> to <code class="leafygreen-ui-1l06pbn"> false </code> . </p> <p class="leafygreen-ui-1kp3ins"> You can use the following sequence of commands to set <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.settings.chainingAllowed"> <code class="leafygreen-ui-1l06pbn"> settings.chainingAllowed </code> </a> to <code class="leafygreen-ui-1l06pbn"> false </code> : </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Copy the configuration settings into the <code class="leafygreen-ui-1l06pbn"> cfg </code> object: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cfg = rs.config()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cfg <!-- -->= <!-- -->rs.<span class="lg-highlight-title lg-highlight-function">config</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> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Take note of whether the current configuration settings contain the <code class="leafygreen-ui-1l06pbn"> settings </code> embedded document. If they do, skip this step. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To avoid data loss, skip this step if the configuration settings contain the <code class="leafygreen-ui-1l06pbn"> settings </code> embedded document. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> If the current configuration settings <strong> do not </strong> contain the <code class="leafygreen-ui-1l06pbn"> settings </code> embedded document, create the embedded document by issuing the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cfg.settings = { }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cfg.<span class="lg-highlight-property">settings</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> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Issue the following sequence of commands to set <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.settings.chainingAllowed"> <code class="leafygreen-ui-1l06pbn"> settings.chainingAllowed </code> </a> to <code class="leafygreen-ui-1l06pbn"> false </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cfg.settings.chainingAllowed = false\nrs.reconfig(cfg)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cfg.<span class="lg-highlight-property">settings</span>.<span class="lg-highlight-property">chainingAllowed</span> <!-- -->= <span class="lg-highlight-literal">false</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">reconfig</span>(<!-- -->cfg)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ol> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Re-enable Chained Replication <a class="headerlink leafygreen-ui-1kepx47" href="#re-enable-chained-replication" 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="re-enable-chained-replication"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To re-enable chained replication, set <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.settings.chainingAllowed"> <code class="leafygreen-ui-1l06pbn"> settings.chainingAllowed </code> </a> to <code class="leafygreen-ui-1l06pbn"> true </code> . You can use the following sequence of commands: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cfg = rs.config()\ncfg.settings.chainingAllowed = true\nrs.reconfig(cfg)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cfg <!-- -->= <!-- -->rs.<span class="lg-highlight-title lg-highlight-function">config</span>(<!-- -->)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">cfg.<span class="lg-highlight-property">settings</span>.<span class="lg-highlight-property">chainingAllowed</span> <!-- -->= <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">reconfig</span>(<!-- -->cfg)</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> </section> </section>
https://www.mongodb.com/docs/manual/reference/text-search-languages/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Text Search Languages on Self-Managed Deployments <a class="headerlink leafygreen-ui-1kepx47" href="#text-search-languages-on-self-managed-deployments" 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="text-search-languages-on-self-managed-deployments"> </div> </a> </h1> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page describes text query capabilities for self-managed (non-Atlas) deployments. For data hosted on MongoDB Atlas, MongoDB offers an improved full-text query solution, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/" target="_self"> <span> Atlas Search <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-type-text"> text index </a> and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/text/#mongodb-query-op.-text"> <code class="leafygreen-ui-1l06pbn"> $text </code> </a> operator may be used with the following languages, and accepts either the two-letter ISO 639-1 language code or the long form of the language name: </p> <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> Language Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> ISO 639-1 (Two letter codes) </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> danish </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> da </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> dutch </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> nl </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> english </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> en </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> finnish </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> fi </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> french </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> fr </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> german </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> de </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> hungarian </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> hu </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> italian </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> it </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> norwegian </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> nb </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> portuguese </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> pt </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> romanian </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> ro </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> russian </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> ru </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> spanish </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> es </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> swedish </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> sv </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> turkish </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> tr </code> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> If you specify a <code class="leafygreen-ui-1l06pbn"> default_language </code> value of <code class="leafygreen-ui-1l06pbn"> none </code> , the text index parses through each word in the field, including stop words, and ignores suffix stemming. </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/indexes/index-types/index-text/specify-text-index-language/"> Specify the Default Language for a Text Index on Self-Managed Deployments </a> </p> </div> </div> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/second/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $second (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-second--aggregation-" 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="-second--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $second </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-second" 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-expression-exp.-second"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns the second portion of a date as a number between 0 and 59, but can be 60 to account for leap seconds. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-second" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $second </code> </span> </a> expression has the following <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> operator expression syntax <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $second: &lt;dateexpression&gt; }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$second</span>: &lt;<!-- -->dateExpression<!-- -->&gt; <!-- -->}</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 argument can be: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> An <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-date"> Date </a> , a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-timestamp"> Timestamp </a> , or an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-object-id"> ObjectID <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A document with this format: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ date: &lt;dateexpression&gt;, timezone: &lt;tzexpression&gt; }","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">{ <span class="lg-highlight-attr">date</span>: &lt;<!-- -->dateExpression<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-attr">timezone</span>: &lt;<!-- -->tzExpression<!-- -->&gt; <!-- -->}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:25%"/> <col style="width:75%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> date </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The date to which the operator is applied. <code class="leafygreen-ui-1l06pbn"> &lt;dateExpression&gt; </code> must be a valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-date"> Date </a> , a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-timestamp"> Timestamp </a> , or an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-object-id"> ObjectID <!-- --> . </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timezone </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The timezone of the operation result. <code class="leafygreen-ui-1l06pbn"> &lt;tzExpression&gt; </code> must be a valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a string formatted as either an <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones" rel="noopener noreferrer"> <span> Olson Timezone Identifier </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> or a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/List_of_UTC_time_offsets" rel="noopener noreferrer"> <span> UTC Offset </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> . If no <code class="leafygreen-ui-1l06pbn"> timezone </code> is provided, the result is in UTC. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Format </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Examples </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> Olson Timezone Identifier </code> </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":"\"America/New_York\"\n\"Europe/London\"\n\"GMT\""} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">"America/New_York"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">"Europe/London"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">"GMT"</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> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> UTC Offset </code> </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":"+/-[hh]:[mm], e.g. \"+04:45\"\n+/-[hh][mm], e.g. \"-0530\"\n+/-[hh], e.g. \"+03\""} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">+/-[hh]:[mm], e.g. "+04:45"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">+/-[hh][mm], e.g. "-0530"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">+/-[hh], e.g. "+03"</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> </td> </tr> </tbody> </table> </div> </div> </div> </td> </tr> </tbody> </table> </div> </li> </ul> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:90%"/> <col style="width:10%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Result </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $second: new Date(\"2012-11-06T00:14:20\") }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$second</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2012-11-06T00:14:20"</span>) }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 20 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $second: { date: new Date(\"Jan 7, 2003\") } }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$second</span>: <!-- -->{ <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"Jan 7, 2003"</span>) } }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 0 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $second: {\n date: new Date(\"August 14, 2011\"),\n timezone: \"America/Chicago\"\n} }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$second</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"August 14, 2011"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timezone</span>: <span class="lg-highlight-string">"America/Chicago"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 0 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $second: ISODate(\"1998-11-07T00:00:42Z\") }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$second</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"1998-11-07T00:00:42Z"</span>) }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 42 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $second: {\n date: ISODate(\"1998-11-07T00:00:09Z\"),\n timezone: \"+0530\"\n} }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$second</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"1998-11-07T00:00:09Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timezone</span>: <span class="lg-highlight-string">"+0530"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 9 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $second: \"March 28, 1976\" }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$second</span>: <span class="lg-highlight-string">"March 28, 1976"</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> error </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $second: Date(\"2016-01-01\") }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$second</span>: <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2016-01-01"</span>) }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> error </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $second: \"2009-04-09\" }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$second</span>: <span class="lg-highlight-string">"2009-04-09"</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> error </code> </div> </div> </td> </tr> </tbody> </table> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> $second cannot take a string as an argument. </strong> </h3> <div class="leafygreen-ui-9mycqc"> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Consider a <code class="leafygreen-ui-1l06pbn"> sales </code> collection with the following document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : 1,\n \"item\" : \"abc\",\n \"price\" : 10,\n \"quantity\" : 2,\n \"date\" : ISODate(\"2014-01-01T08:15:39.736Z\")\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">10</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-01-01T08:15:39.736Z"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following aggregation uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-second" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $second </code> </span> </a> and other date expressions to break down the <code class="leafygreen-ui-1l06pbn"> date </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.sales.aggregate(\n [\n {\n $project:\n {\n year: { $year: \"$date\" },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" },\n hour: { $hour: \"$date\" },\n minutes: { $minute: \"$date\" },\n seconds: { $second: \"$date\" },\n milliseconds: { $millisecond: \"$date\" },\n dayOfYear: { $dayOfYear: \"$date\" },\n dayOfWeek: { $dayOfWeek: \"$date\" },\n week: { $week: \"$date\" }\n }\n }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">sales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">year</span>: <!-- -->{ <span class="lg-highlight-attr">$year</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">month</span>: <!-- -->{ <span class="lg-highlight-attr">$month</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">day</span>: <!-- -->{ <span class="lg-highlight-attr">$dayOfMonth</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">hour</span>: <!-- -->{ <span class="lg-highlight-attr">$hour</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">minutes</span>: <!-- -->{ <span class="lg-highlight-attr">$minute</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">seconds</span>: <!-- -->{ <span class="lg-highlight-attr">$second</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">milliseconds</span>: <!-- -->{ <span class="lg-highlight-attr">$millisecond</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dayOfYear</span>: <!-- -->{ <span class="lg-highlight-attr">$dayOfYear</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dayOfWeek</span>: <!-- -->{ <span class="lg-highlight-attr">$dayOfWeek</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">week</span>: <!-- -->{ <span class="lg-highlight-attr">$week</span>: <span class="lg-highlight-string">"$date"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following result: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : 1,\n \"year\" : 2014,\n \"month\" : 1,\n \"day\" : 1,\n \"hour\" : 8,\n \"minutes\" : 15,\n \"seconds\" : 39,\n \"milliseconds\" : 736,\n \"dayOfYear\" : 1,\n \"dayOfWeek\" : 4,\n \"week\" : 0\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"year"</span> <!-- -->: <span class="lg-highlight-number">2014</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"month"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"day"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"hour"</span> <!-- -->: <span class="lg-highlight-number">8</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"minutes"</span> <!-- -->: <span class="lg-highlight-number">15</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"seconds"</span> <!-- -->: <span class="lg-highlight-number">39</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"milliseconds"</span> <!-- -->: <span class="lg-highlight-number">736</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dayOfYear"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dayOfWeek"</span> <!-- -->: <span class="lg-highlight-number">4</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"week"</span> <!-- -->: <span class="lg-highlight-number">0</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/db.createCollection/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.createCollection() <a class="headerlink leafygreen-ui-1kepx47" href="#db.createcollection--" 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.createcollection--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#access-control" target="_self"> <span> Access Control </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.createCollection(name, options) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.createCollection" 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-method-db.createCollection"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Creates a new collection. For <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/#std-label-views-landing-page"> views </a> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createView/#mongodb-method-db.createView"> <code class="leafygreen-ui-1l06pbn"> db.createView() </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Because MongoDB creates a collection implicitly when the collection is first referenced in a command, this method is used primarily for creating new collections that use specific options. For example, you use <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> to create a: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-capped-collection"> Capped collection <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-clustered-collection"> Clustered collection <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> New collection that uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/schema-validation/#std-label-schema-validation-overview"> document validation <!-- --> . </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> is a wrapper around the database command <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/create/#mongodb-dbcommand-dbcmd.create"> <code class="leafygreen-ui-1l06pbn"> create </code> . </a> </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can use <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> for deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> method has the following prototype form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection( &lt;name&gt;,\n {\n capped: &lt;boolean&gt;,\n timeseries: { // Added in MongoDB 5.0\n timeField: &lt;string&gt;, // required for time series collections\n metaField: &lt;string&gt;,\n granularity: &lt;string&gt;,\n bucketMaxSpanSeconds: &lt;number&gt;, // Added in MongoDB 6.3\n bucketRoundingSeconds: &lt;number&gt; // Added in MongoDB 6.3\n },\n expireAfterSeconds: &lt;number&gt;,\n clusteredIndex: &lt;document&gt;, // Added in MongoDB 5.3\n changeStreamPreAndPostImages: &lt;document&gt;, // Added in MongoDB 6.0\n size: &lt;number&gt;,\n max: &lt;number&gt;,\n storageEngine: &lt;document&gt;,\n validator: &lt;document&gt;,\n validationLevel: &lt;string&gt;,\n validationAction: &lt;string&gt;,\n indexOptionDefaults: &lt;document&gt;,\n viewOn: &lt;string&gt;,\n pipeline: &lt;pipeline&gt;,\n collation: &lt;document&gt;,\n writeConcern: &lt;document&gt;\n }\n )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>( &lt;<!-- -->name<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">capped</span>: &lt;<!-- -->boolean<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeseries</span>: <!-- -->{ <span class="lg-highlight-comment">// Added in MongoDB 5.0</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeField</span>: &lt;<!-- -->string<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-comment">//</span><span class="lg-highlight-comment"> required for time </span><span class="lg-highlight-comment">series collections</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metaField</span>: &lt;<!-- -->string<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">granularity</span>: &lt;<!-- -->string<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bucketMaxSpanSeconds</span>: &lt;<!-- -->number<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-comment">// Added in MongoDB 6.3</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bucketRoundingSeconds</span>: &lt;<!-- -->number<!-- -->&gt; <span class="lg-highlight-comment">// Added in MongoDB 6.3</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">expireAfterSeconds</span>: &lt;<!-- -->number<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">clusteredIndex</span>: &lt;<span class="lg-highlight-variable lg-highlight-language">document</span>&gt;<!-- -->,<!-- --> <span class="lg-highlight-comment">// Added in MongoDB 5.3</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">changeStreamPreAndPostImages</span>: &lt;<span class="lg-highlight-variable lg-highlight-language">document</span>&gt;<!-- -->,<!-- --> <span class="lg-highlight-comment">// Added in MongoDB 6.0</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: &lt;<!-- -->number<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">max</span>: &lt;<!-- -->number<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">storageEngine</span>: &lt;<span class="lg-highlight-variable lg-highlight-language">document</span>&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">validator</span>: &lt;<span class="lg-highlight-variable lg-highlight-language">document</span>&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">validationLevel</span>: &lt;<!-- -->string<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">validationAction</span>: &lt;<!-- -->string<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">indexOptionDefaults</span>: &lt;<span class="lg-highlight-variable lg-highlight-language">document</span>&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">viewOn</span>: &lt;<!-- -->string<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pipeline</span>: &lt;<!-- -->pipeline<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collation</span>: &lt;<span class="lg-highlight-variable lg-highlight-language">document</span>&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">writeConcern</span>: &lt;<span class="lg-highlight-variable lg-highlight-language">document</span>&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-create_collection_parameters"> </span> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> method has the following parameters: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> name </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The name of the collection to create. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/limits/#std-label-restrictions-on-db-names"> Naming Restrictions <!-- --> . </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> options </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Configuration options for creating a: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Capped collection </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Clustered collection </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> View </p> </li> </ul> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> options </code> document contains the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:25%"/> <col style="width:20%"/> <col style="width:75%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> capped </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. To create a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-capped-collection"> capped collection </a> , specify <code class="leafygreen-ui-1l06pbn"> true </code> . If you specify <code class="leafygreen-ui-1l06pbn"> true </code> , you must also set a maximum size in the <code class="leafygreen-ui-1l06pbn"> size </code> field. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timeseries.timeField </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Required when creating a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-time-series-collection"> time series collection </a> . The name of the field which contains the date in each time series document. Documents in a time series collection must have a valid BSON date as the value for the <code class="leafygreen-ui-1l06pbn"> timeField </code> . </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timeseries.metaField </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The name of the field which contains metadata in each time series document. The metadata in the specified field should be data that is used to label a unique series of documents. The metadata should rarely, if ever, change. </p> <p class="leafygreen-ui-1kp3ins"> The name of the specified field may not be <code class="leafygreen-ui-1l06pbn"> _id </code> or the same as the <code class="leafygreen-ui-1l06pbn"> timeseries.timeField </code> . The field can be of any type except array. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timeseries.granularity </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional, do not use if setting <code class="leafygreen-ui-1l06pbn"> bucketRoundingSeconds </code> and <code class="leafygreen-ui-1l06pbn"> bucketMaxSpanSeconds </code> . Possible values are <code class="leafygreen-ui-1l06pbn"> seconds </code> (default), <code class="leafygreen-ui-1l06pbn"> minutes </code> , and <code class="leafygreen-ui-1l06pbn"> hours </code> . </p> <p class="leafygreen-ui-1kp3ins"> Set <code class="leafygreen-ui-1l06pbn"> granularity </code> to the value that most closely matches the time between consecutive incoming timestamps. This improves performance by optimizing how MongoDB internally stores data in the collection. </p> <p class="leafygreen-ui-1kp3ins"> For more information on granularity and bucket intervals, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-granularity/#std-label-timeseries-granularity"> Set Granularity for Time Series Data <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timeseries.bucketMaxSpanSeconds </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional, used with <code class="leafygreen-ui-1l06pbn"> bucketRoundingSeconds </code> as an alternative to <code class="leafygreen-ui-1l06pbn"> granularity </code> . Sets the maximum time between timestamps in the same bucket. Possible values are 1-31536000. If you set <code class="leafygreen-ui-1l06pbn"> bucketMaxSpanSeconds </code> , you must set <code class="leafygreen-ui-1l06pbn"> bucketRoundingSeconds </code> to the same value. </p> <p class="leafygreen-ui-1kp3ins"> To downgrade below MongoDB 6.3, you must either modify the collection to use the corresponding <code class="leafygreen-ui-1l06pbn"> granularity </code> value, or drop the collection. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timeseries.bucketRoundingSeconds </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional, used with <code class="leafygreen-ui-1l06pbn"> bucketMaxSpanSeconds </code> as an alternative to <code class="leafygreen-ui-1l06pbn"> granularity </code> . Sets the number of seconds to round down by when MongoDB sets the minimum timestamp for a new bucket. Must be equal to <code class="leafygreen-ui-1l06pbn"> bucketMaxSpanSeconds </code> . </p> <p class="leafygreen-ui-1kp3ins"> For example, setting both parameters to <code class="leafygreen-ui-1l06pbn"> 1800 </code> rounds new buckets down to the nearest 30 minutes. If a document with a time of <code class="leafygreen-ui-1l06pbn"> 2023-03-27T18:24:35Z </code> does not fit an existing bucket, MongoDB creates a new bucket with a minimum time of <code class="leafygreen-ui-1l06pbn"> 2023-03-27T18:00:00Z </code> and a maximum time of <code class="leafygreen-ui-1l06pbn"> 2023-03-27T18:30:00Z </code> . </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> number </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-db.createCollection.expireAfterSeconds"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. Specifies the seconds after which documents in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-time-series-collection"> time series collection </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-clustered-collection"> clustered collection </a> expire. MongoDB deletes expired documents automatically. </p> <p class="leafygreen-ui-1kp3ins"> For clustered collections, the documents are deleted automatically based on the clustered index key <code class="leafygreen-ui-1l06pbn"> _id </code> and the values must be date types. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-ttl/#std-label-index-feature-ttl"> TTL Indexes <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> clusteredIndex </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-db.createCollection.clusteredIndex"> </span> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.3, you can create a collection with a <strong> clustered index </strong> . Clustered indexes are stored in the same <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/wiredtiger/#std-label-storage-wiredtiger"> WiredTiger </a> file as the collection. The resulting collection is called a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/clustered-collections/#std-label-clustered-collections"> clustered collection <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> clusteredIndex </code> field has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"clusteredIndex: {\n key: &lt;object&gt;,\n unique: &lt;boolean&gt;,\n name: &lt;string&gt;\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">clusteredIndex</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">key</span>: &lt;<!-- -->object<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">unique</span>: &lt;<!-- -->boolean<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: &lt;<!-- -->string<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <dl> <dt> <code class="leafygreen-ui-1l06pbn"> key </code> </dt> <dd class="css-1ufxuu7"> Required. The clustered index key field. Must be set to <code class="leafygreen-ui-1l06pbn"> { _id: 1 } </code> . The default value for the <code class="leafygreen-ui-1l06pbn"> _id </code> field is an automatically generated unique <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-objectid"> object identifier </a> , but you can set your own <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/clustered-collections/#std-label-clustered-collections-clustered-index-key-values"> clustered index key values <!-- --> . </a> </dd> <dt> <code class="leafygreen-ui-1l06pbn"> unique </code> </dt> <dd class="css-1ufxuu7"> Required. Must be set to <code class="leafygreen-ui-1l06pbn"> true </code> . A unique index indicates the collection will not accept inserted or updated documents where the clustered index key value matches an existing value in the index. </dd> <dt> <code class="leafygreen-ui-1l06pbn"> name </code> </dt> <dd class="css-1ufxuu7"> Optional. A name that uniquely identifies the clustered index. </dd> </dl> <div> <p> <em> New <!-- --> in version <!-- --> 5.3 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> changeStreamPreAndPostImages </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-db.createCollection.changeStreamPreAndPostImages"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 6.0, you can use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/change-events/#std-label-change-stream-output"> change stream events </a> to output the version of a document before and after changes (the document pre- and post-images): </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The pre-image is the document before it was replaced, updated, or deleted. There is no pre-image for an inserted document. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The post-image is the document after it was inserted, replaced, or updated. There is no post-image for a deleted document. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Enable <code class="leafygreen-ui-1l06pbn"> changeStreamPreAndPostImages </code> for a collection using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createCollection" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </span> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/create/#mongodb-dbcommand-dbcmd.create"> <code class="leafygreen-ui-1l06pbn"> create </code> </a> , or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> . </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> changeStreamPreAndPostImages </code> has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"changeStreamPreAndPostImages: {\n enabled: &lt;boolean&gt;\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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"><span class="lg-highlight-attr">changeStreamPreAndPostImages</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">enabled</span>: &lt;<!-- -->boolean<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To enable change stream pre- and post-images for the collection, set <code class="leafygreen-ui-1l06pbn"> enabled </code> to <code class="leafygreen-ui-1l06pbn"> true </code> . </p> <p class="leafygreen-ui-1kp3ins"> For complete examples with the change stream output, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.watch/#std-label-db.collection.watch-change-streams-pre-and-post-images-example"> Change Streams with Document Pre- and Post-Images <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> For a <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> example on this page, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-createCollection-change-stream-pre-and-post-images-example" target="_self"> <span> Create a Collection with Change Stream Pre- and Post-Images for Documents <!-- --> . </span> </a> </p> <div> <p> <em> New <!-- --> in version <!-- --> 6.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> size </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> number </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. Specify a maximum size in bytes for a capped collection. Once a capped collection reaches its maximum size, MongoDB removes the older documents to make space for the new documents. The <code class="leafygreen-ui-1l06pbn"> size </code> field is required for capped collections and ignored for other collections. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> max </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> number </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. The maximum number of documents allowed in the capped collection. The <code class="leafygreen-ui-1l06pbn"> size </code> limit takes precedence over this limit. If a capped collection reaches the <code class="leafygreen-ui-1l06pbn"> size </code> limit before it reaches the maximum number of documents, MongoDB removes old documents. If you prefer to use the <code class="leafygreen-ui-1l06pbn"> max </code> limit, ensure that the <code class="leafygreen-ui-1l06pbn"> size </code> limit, which is required for a capped collection, is sufficient to contain the maximum number of documents. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> storageEngine </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Available for the WiredTiger storage engine only. </p> <p class="leafygreen-ui-1kp3ins"> Allows users to specify configuration to the storage engine on a per-collection basis when creating a collection. The value of the <code class="leafygreen-ui-1l06pbn"> storageEngine </code> option should take the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ &lt;storage-engine-name&gt;: &lt;options&gt; }","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">{ &lt;<!-- -->storage<!-- -->-<!-- -->engine<!-- -->-<!-- -->name<!-- -->&gt;<!-- -->: &lt;<!-- -->options<!-- -->&gt; <!-- -->}</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"> Storage engine configuration specified when creating collections are validated and logged to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> during replication to support replica sets with members that use different storage engines. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 7.2, you can't specify <code class="leafygreen-ui-1l06pbn"> wiredTiger </code> storage engine encryption options when you create a collection with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createCollection" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </span> </a> . To configure encryption for the WiredTiger storage engine, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-encryption-at-rest/#std-label-security-encryption-at-rest"> Encryption at Rest <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> For details, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-create-collection-storage-engine-options" target="_self"> <span> Specify Storage Engine Options <!-- --> . </span> </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> validator </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Allows users to specify <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/schema-validation/#std-label-schema-validation-overview"> validation rules or expressions </a> for the collection. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> validator </code> option takes a document that specifies the validation rules or expressions. You can specify the expressions using the same operators as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> with the exception of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/near/#mongodb-query-op.-near"> <code class="leafygreen-ui-1l06pbn"> $near </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/nearSphere/#mongodb-query-op.-nearSphere"> <code class="leafygreen-ui-1l06pbn"> $nearSphere </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/text/#mongodb-query-op.-text"> <code class="leafygreen-ui-1l06pbn"> $text </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/where/#mongodb-query-op.-where"> <code class="leafygreen-ui-1l06pbn"> $where </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To learn how to create a collection with schema validation, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/schema-validation/specify-json-schema/#std-label-schema-validation-json"> Specify JSON Schema Validation <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> validationLevel </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Determines how strictly MongoDB applies the validation rules to existing documents during an update. </p> <dl> <dt> <code class="leafygreen-ui-1l06pbn"> "off" </code> </dt> <dd class="css-1ufxuu7"> No validation for inserts or updates. </dd> <dt> <code class="leafygreen-ui-1l06pbn"> "strict" </code> </dt> <dd class="css-1ufxuu7"> <strong> Default </strong> Apply validation rules to all inserts and all updates. </dd> <dt> <code class="leafygreen-ui-1l06pbn"> "moderate" </code> </dt> <dd class="css-1ufxuu7"> Apply validation rules to inserts and to updates on existing <em> valid </em> documents. Do not apply rules to updates on existing <em> invalid </em> documents. </dd> </dl> <p class="leafygreen-ui-1kp3ins"> To see an example that uses <code class="leafygreen-ui-1l06pbn"> validationLevel </code> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/schema-validation/specify-validation-level/#std-label-schema-specify-validation-level"> Specify Validation Level for Existing Documents <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> validationAction </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Determines whether to <code class="leafygreen-ui-1l06pbn"> error </code> on invalid documents or just <code class="leafygreen-ui-1l06pbn"> warn </code> about the violations but allow invalid documents to be inserted. </p> <p class="leafygreen-ui-1kp3ins"> <strong class="css-rws738"> IMPORTANT: </strong> Validation of documents only applies to those documents as determined by the <code class="leafygreen-ui-1l06pbn"> validationLevel </code> . </p> <p class="leafygreen-ui-1kp3ins"> To see an example that uses <code class="leafygreen-ui-1l06pbn"> validationAction </code> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/schema-validation/handle-invalid-documents/#std-label-schema-validation-handle-invalid-docs"> Choose How to Handle Invalid Documents <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> indexOptionDefaults </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Allows users to specify a default configuration for indexes when creating a collection. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> indexOptionDefaults </code> option accepts a <code class="leafygreen-ui-1l06pbn"> storageEngine </code> document, which should take the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ &lt;storage-engine-name&gt;: &lt;options&gt; }","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">{ &lt;<!-- -->storage<!-- -->-<!-- -->engine<!-- -->-<!-- -->name<!-- -->&gt;<!-- -->: &lt;<!-- -->options<!-- -->&gt; <!-- -->}</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"> Storage engine configuration specified when creating indexes are validated and logged to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> during replication to support replica sets with members that use different storage engines. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> viewOn </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The name of the source collection or view from which to create a view. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createView/#mongodb-method-db.createView"> <code class="leafygreen-ui-1l06pbn"> db.createView() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> pipeline </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> array </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An array that consists of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/aggregation-pipeline/#std-label-aggregation-pipeline"> aggregation pipeline stage(s) </a> . <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createView/#mongodb-method-db.createView"> <code class="leafygreen-ui-1l06pbn"> db.createView() </code> </a> creates a view by applying the specified <code class="leafygreen-ui-1l06pbn"> pipeline </code> to the <code class="leafygreen-ui-1l06pbn"> viewOn </code> collection or view. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createView/#mongodb-method-db.createView"> <code class="leafygreen-ui-1l06pbn"> db.createView() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> collation </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Specifies the default <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> collation </a> for the collection. </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> Collation </a> allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks. </p> <p class="leafygreen-ui-1kp3ins"> The collation option has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collation: {\n locale: &lt;string&gt;,\n caseLevel: &lt;boolean&gt;,\n caseFirst: &lt;string&gt;,\n strength: &lt;int&gt;,\n numericOrdering: &lt;boolean&gt;,\n alternate: &lt;string&gt;,\n maxVariable: &lt;string&gt;,\n backwards: &lt;boolean&gt;\n}"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" 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">collation: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> locale: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> caseLevel: &lt;boolean&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> caseFirst: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> strength: &lt;int&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> numericOrdering: &lt;boolean&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> alternate: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> maxVariable: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> backwards: &lt;boolean&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> When specifying collation, the <code class="leafygreen-ui-1l06pbn"> locale </code> field is mandatory; all other collation fields are optional. For descriptions of the fields, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation-document-fields"> Collation Document <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If you specify a collation at the collection level: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Indexes on that collection will be created with that collation unless the index creation operation explicitly specify a different collation. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Operations on that collection use the collection's default collation unless they explicitly specify a different collation. </p> <p class="leafygreen-ui-1kp3ins"> You cannot specify multiple collations for an operation. For example, you cannot specify different collations per field, or if performing a find with a sort, you cannot use one collation for the find and another for the sort. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If no collation is specified for the collection or for the operations, MongoDB uses the simple binary comparison used in prior versions for string comparisons. </p> <p class="leafygreen-ui-1kp3ins"> For a collection, you can only specify the collation during the collection creation. Once set, you cannot modify the collection's default collation. </p> <p class="leafygreen-ui-1kp3ins"> For an example, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-createCollection-collation-example" target="_self"> <span> Specify Collation <!-- --> . </span> </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> writeConcern </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. A document that expresses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern"> write concern </a> for the operation. Omit to use the default write concern. </p> <p class="leafygreen-ui-1kp3ins"> When issued on a sharded cluster, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> converts the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern"> write concern </a> of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/create/#mongodb-dbcommand-dbcmd.create"> <code class="leafygreen-ui-1l06pbn"> create </code> </a> command and its helper <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createCollection" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </span> </a> to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> . </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Access Control <a class="headerlink leafygreen-ui-1kepx47" href="#access-control" 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="access-control"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If the deployment enforces <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-authentication"> authentication/authorization </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createCollection" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </span> </a> requires the following privileges: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Task </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Required Privileges </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Create a non-capped collection </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-createCollection"> <code class="leafygreen-ui-1l06pbn"> createCollection </code> </a> on the database, <strong> or </strong> </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-insert"> <code class="leafygreen-ui-1l06pbn"> insert </code> </a> on the collection to create </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Create a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/capped-collections/#std-label-manual-capped-collection"> capped collection </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-convertToCapped"> <code class="leafygreen-ui-1l06pbn"> convertToCapped </code> </a> for the collection </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-createCollection"> <code class="leafygreen-ui-1l06pbn"> createCollection </code> </a> on the database </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Create a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/#std-label-views-landing-page"> view </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-createCollection"> <code class="leafygreen-ui-1l06pbn"> createCollection </code> </a> on the database. </p> <p class="leafygreen-ui-1kp3ins"> However, if the user has the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-createCollection"> <code class="leafygreen-ui-1l06pbn"> createCollection </code> </a> on the database <em> and </em> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-find"> <code class="leafygreen-ui-1l06pbn"> find </code> </a> on the view to create, the user must <em> also </em> have the following additional permissions: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-find"> <code class="leafygreen-ui-1l06pbn"> find </code> </a> on the source collection or view. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-find"> <code class="leafygreen-ui-1l06pbn"> find </code> </a> on any other collections or views referenced in the <code class="leafygreen-ui-1l06pbn"> pipeline </code> , if any. </p> </li> </ul> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> A user with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-readWrite"> <code class="leafygreen-ui-1l06pbn"> readWrite </code> </a> built in role on the database has the required privileges to run the listed operations. Either <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/create-users/#std-label-create-users"> create a user </a> with the required role or <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-users-and-roles/#std-label-modify-existing-user-access"> grant the role to an existing user <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> has the following behavior: </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Resource Locking <a class="headerlink leafygreen-ui-1kepx47" href="#resource-locking" 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="resource-locking"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createCollection" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </span> </a> obtains an exclusive lock on the specified collection or view for the duration of the operation. All subsequent operations on the collection must wait until <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createCollection" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </span> </a> releases the lock. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createCollection" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </span> </a> typically holds this lock for a short time. </p> <p class="leafygreen-ui-1kp3ins"> Creating a view requires obtaining an additional exclusive lock on the <code class="leafygreen-ui-1l06pbn"> system.views </code> collection in the database. This lock blocks creation or modification of views in the database until the command completes. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Transactions <a class="headerlink leafygreen-ui-1kepx47" href="#transactions" 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="transactions"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can create collections and indexes inside a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions-create-collections-indexes"> distributed transaction </a> if the transaction is <strong class="css-4dei7l"> not </strong> a cross-shard write transaction. </p> <p class="leafygreen-ui-1kp3ins"> To use <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> in a transaction, the transaction must use read concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-local/#mongodb-readconcern-readconcern.-local-"> <code class="leafygreen-ui-1l06pbn"> "local" </code> </a> . If you specify a read concern level other than <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-local/#mongodb-readconcern-readconcern.-local-"> <code class="leafygreen-ui-1l06pbn"> "local" </code> </a> , the transaction fails. </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/transactions/#std-label-transactions-create-collections-indexes"> Create Collections and Indexes in a Transaction </a> </p> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Collection or View with Same Name and Options <a class="headerlink leafygreen-ui-1kepx47" href="#collection-or-view-with-same-name-and-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="collection-or-view-with-same-name-and-options"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you run <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> with the same name and options as an existing collection or view, <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> returns success. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create a Capped Collection <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-capped-collection" 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-capped-collection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Capped collections have maximum size or document counts that prevent them from growing beyond maximum thresholds. All capped collections must specify a maximum size and may also specify a maximum document count. MongoDB removes older documents if a collection reaches the maximum size limit before it reaches the maximum document count. Consider the following example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection(\"log\", { capped : true, size : 5242880, max : 5000 } )","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-title lg-highlight-function">createCollection</span>(<span class="lg-highlight-string">"log"</span>, <!-- -->{ <!-- -->capped <!-- -->: <span class="lg-highlight-literal">true</span>, <!-- -->size <!-- -->: <span class="lg-highlight-number">5242880</span>, <!-- -->max <!-- -->: <span class="lg-highlight-number">5000</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"> This command creates a collection named <code class="leafygreen-ui-1l06pbn"> log </code> with a maximum size of 5 megabytes and a maximum of 5000 documents. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/capped-collections/#std-label-manual-capped-collection"> Capped Collections </a> for more information about capped collections. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create a Time Series Collection <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-time-series-collection" 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-time-series-collection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To create a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-time-series-collection"> time series collection </a> that captures weather data for the past 24 hours, issue this command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection(\n \"weather24h\",\n {\n timeseries: {\n timeField: \"timestamp\",\n metaField: \"data\",\n granularity: \"hours\"\n },\n expireAfterSeconds: 86400\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"weather24h"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeseries</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeField</span>: <span class="lg-highlight-string">"timestamp"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metaField</span>: <span class="lg-highlight-string">"data"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">granularity</span>: <span class="lg-highlight-string">"hours"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">expireAfterSeconds</span>: <span class="lg-highlight-number">86400</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Alternately, to create the same collection but limit each bucket to timestamp values within the same hour, issue this command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection(\n \"weather24h\",\n {\n timeseries: {\n timeField: \"timestamp\",\n metaField: \"data\",\n bucketMaxSpanSeconds: \"3600\",\n bucketRoundingSeconds: \"3600\"\n },\n expireAfterSeconds: 86400\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"weather24h"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeseries</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeField</span>: <span class="lg-highlight-string">"timestamp"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metaField</span>: <span class="lg-highlight-string">"data"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bucketMaxSpanSeconds</span>: <span class="lg-highlight-string">"3600"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bucketRoundingSeconds</span>: <span class="lg-highlight-string">"3600"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">expireAfterSeconds</span>: <span class="lg-highlight-number">86400</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create a Clustered Collection <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-clustered-collection" 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-clustered-collection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createCollection" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </span> </a> example adds a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/clustered-collections/#std-label-clustered-collections"> clustered collection </a> named <code class="leafygreen-ui-1l06pbn"> stocks </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection(\n \"stocks\",\n { clusteredIndex: { \"key\": { _id: 1 }, \"unique\": true, \"name\": \"stocks clustered key\" } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"stocks"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">clusteredIndex</span>: <!-- -->{ <span class="lg-highlight-string">"key"</span>: <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span> }<!-- -->, <span class="lg-highlight-string">"unique"</span>: <span class="lg-highlight-literal">true</span>, <span class="lg-highlight-string">"name"</span>: <span class="lg-highlight-string">"stocks clustered key"</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-db.createCollection.clusteredIndex" target="_self"> <span> clusteredIndex </span> </a> specifies: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "key": { _id: 1 } </code> , which sets the clustered index key to the <code class="leafygreen-ui-1l06pbn"> _id </code> field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "unique": true </code> , which indicates the clustered index key value must be unique. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "name": "stocks clustered key" </code> , which sets the clustered index name. </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-createCollection-change-stream-pre-and-post-images-example"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create a Collection with Change Stream Pre- and Post-Images for Documents <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-collection-with-change-stream-pre--and-post-images-for-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="create-a-collection-with-change-stream-pre--and-post-images-for-documents"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 6.0, you can use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/change-events/#std-label-change-stream-output"> change stream events </a> to output the version of a document before and after changes (the document pre- and post-images): </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The pre-image is the document before it was replaced, updated, or deleted. There is no pre-image for an inserted document. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The post-image is the document after it was inserted, replaced, or updated. There is no post-image for a deleted document. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Enable <code class="leafygreen-ui-1l06pbn"> changeStreamPreAndPostImages </code> for a collection using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createCollection" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </span> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/create/#mongodb-dbcommand-dbcmd.create"> <code class="leafygreen-ui-1l06pbn"> create </code> </a> , or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> . </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The following example creates a collection that has <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-db.createCollection.changeStreamPreAndPostImages" target="_self"> <span> changeStreamPreAndPostImages </span> </a> enabled: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection(\n \"temperatureSensor\",\n { changeStreamPreAndPostImages: { enabled: true } }\n);","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"temperatureSensor"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">changeStreamPreAndPostImages</span>: <!-- -->{ <span class="lg-highlight-attr">enabled</span>: <span class="lg-highlight-literal">true</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Pre- and post-images are not available for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/change-events/#std-label-change-stream-output"> change stream event </a> if the images were: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Not enabled on the collection at the time of a document update or delete operation. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Removed after the pre- and post-image retention time set in <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> . </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The following example sets <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> to <code class="leafygreen-ui-1l06pbn"> 100 </code> seconds on an entire cluster: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use admin\ndb.runCommand( {\n setClusterParameter:\n { changeStreamOptions: {\n preAndPostImages: { expireAfterSeconds: 100 }\n } }\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use admin</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">setClusterParameter</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">changeStreamOptions</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">preAndPostImages</span>: <!-- -->{ <span class="lg-highlight-attr">expireAfterSeconds</span>: <span class="lg-highlight-number">100</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The following example returns the current <code class="leafygreen-ui-1l06pbn"> changeStreamOptions </code> settings, including <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { getClusterParameter: \"changeStreamOptions\" } )","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-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">getClusterParameter</span>: <span class="lg-highlight-string">"changeStreamOptions"</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> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Setting <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> to <code class="leafygreen-ui-1l06pbn"> off </code> uses the default retention policy: pre- and post-images are retained until the corresponding change stream events are removed from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If a change stream event is removed from the oplog, then the corresponding pre- and post-images are also deleted regardless of the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> pre- and post-image retention time. </p> </li> </ul> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Additional considerations: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Enabling pre- and post-images consumes storage space and adds processing time. Only enable pre- and post-images if you need them. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Limit the change stream event size to less than 16 megabytes. To limit the event size, you can: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Limit the document size to 8 megabytes. You can request pre- and post-images simultaneously in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/change-events/#std-label-change-stream-output"> change stream output </a> if other change stream event fields like <code class="leafygreen-ui-1l06pbn"> updateDescription </code> are not large. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Request only post-images in the change stream output for documents up to 16 megabytes if other change stream event fields like <code class="leafygreen-ui-1l06pbn"> updateDescription </code> are not large. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Request only pre-images in the change stream output for documents up to 16 megabytes if: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> document updates affect only a small fraction of the document structure or content, <em> and </em> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> do not cause a <code class="leafygreen-ui-1l06pbn"> replace </code> change event. A <code class="leafygreen-ui-1l06pbn"> replace </code> event always includes the post-image. </p> </li> </ul> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To request a pre-image, you set <code class="leafygreen-ui-1l06pbn"> fullDocumentBeforeChange </code> to <code class="leafygreen-ui-1l06pbn"> required </code> or <code class="leafygreen-ui-1l06pbn"> whenAvailable </code> in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.watch/#mongodb-method-db.collection.watch"> <code class="leafygreen-ui-1l06pbn"> db.collection.watch() </code> </a> . To request a post-image, you set <code class="leafygreen-ui-1l06pbn"> fullDocument </code> using the same method. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Pre-images are written to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data-config.system.preimages"> <code class="leafygreen-ui-1l06pbn"> config.system.preimages </code> </a> collection. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> config.system.preimages </code> collection may become large. To limit the collection size, you can set <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> time for the pre-images as shown earlier. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Pre-images are removed asynchronously by a background process. </p> </li> </ul> </li> </ul> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Backward-Incompatible Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 6.0, if you are using document pre- and post-images for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/change-events/#std-label-change-stream-output"> change streams </a> , you must disable <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#std-label-collMod-change-stream-pre-and-post-images"> changeStreamPreAndPostImages </a> for each collection using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> command before you can downgrade to an earlier MongoDB version. </p> </div> </div> <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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For change stream events and output, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/change-events/#std-label-change-stream-output"> Change Events <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To watch a collection for changes, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.watch/#mongodb-method-db.collection.watch"> <code class="leafygreen-ui-1l06pbn"> db.collection.watch() </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For complete examples with the change stream output, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.watch/#std-label-db.collection.watch-change-streams-pre-and-post-images-example"> Change Streams with Document Pre- and Post-Images <!-- --> . </a> </p> </li> </ul> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-createCollection-collation-example"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify Collation <a class="headerlink leafygreen-ui-1kepx47" href="#specify-collation" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="specify-collation"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> Collation </a> allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks. </p> <p class="leafygreen-ui-1kp3ins"> You can specify <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> collation </a> at the collection or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/#std-label-views-landing-page"> view </a> level. For example, the following operation creates a collection, specifying a collation for the collection (See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation-document-fields"> Collation Document </a> for descriptions of the collation fields): </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection( \"myColl\", { collation: { locale: \"fr\" } } );","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>( <span class="lg-highlight-string">"myColl"</span>, <!-- -->{ <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span> } } )<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This collation will be used by indexes and operations that support collation unless they explicitly specify a different collation. For example, insert the following documents into <code class="leafygreen-ui-1l06pbn"> myColl </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ _id: 1, category: \"café\" }\n{ _id: 2, category: \"cafe\" }\n{ _id: 3, category: \"cafE\" }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"café"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafE"</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation uses the collection's collation: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find().sort( { category: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns documents in the following order: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 2, \"category\" : \"cafe\" }\n{ \"_id\" : 3, \"category\" : \"cafE\" }\n{ \"_id\" : 1, \"category\" : \"café\" }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cafe"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cafE"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"café"</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 same operation on a collection that uses simple binary collation (i.e. no specific collation set) returns documents in the following order: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 3, \"category\" : \"cafE\" }\n{ \"_id\" : 2, \"category\" : \"cafe\" }\n{ \"_id\" : 1, \"category\" : \"café\" }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cafE"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cafe"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"café"</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-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/views/specify-collation/#std-label-create-view-w-collation"> Create a View with Default Collation </a> </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-create-collection-storage-engine-options"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify Storage Engine Options <a class="headerlink leafygreen-ui-1kepx47" href="#specify-storage-engine-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="specify-storage-engine-options"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can specify collection-specific storage engine configuration options when you create a collection with <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> . Consider the following operation: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection(\n \"users\",\n { storageEngine: { wiredTiger: { configString: \"&lt;option&gt;=&lt;setting&gt;\" } } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"users"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">storageEngine</span>: <!-- -->{ <span class="lg-highlight-attr">wiredTiger</span>: <!-- -->{ <span class="lg-highlight-attr">configString</span>: <span class="lg-highlight-string">"&lt;option&gt;=&lt;setting&gt;"</span> } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This operation creates a new collection named <code class="leafygreen-ui-1l06pbn"> users </code> with a specific configuration string that MongoDB will pass to the <code class="leafygreen-ui-1l06pbn"> wiredTiger </code> storage engine. </p> <p class="leafygreen-ui-1kp3ins"> For example, to specify the <code class="leafygreen-ui-1l06pbn"> zlib </code> compressor for file blocks in the <code class="leafygreen-ui-1l06pbn"> users </code> collection, set the <code class="leafygreen-ui-1l06pbn"> block_compressor </code> option with the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection(\n \"users\",\n { storageEngine: { wiredTiger: { configString: \"block_compressor=zlib\" } } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"users"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">storageEngine</span>: <!-- -->{ <span class="lg-highlight-attr">wiredTiger</span>: <!-- -->{ <span class="lg-highlight-attr">configString</span>: <span class="lg-highlight-string">"block_compressor=zlib"</span> } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 7.2, you can't specify <code class="leafygreen-ui-1l06pbn"> wiredTiger </code> storage engine encryption options when you create a collection with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createCollection" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </span> </a> . To configure encryption for the WiredTiger storage engine, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-encryption-at-rest/#std-label-security-encryption-at-rest"> Encryption at Rest <!-- --> . </a> </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/troubleshoot-replica-sets/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Troubleshoot Replica Sets <a class="headerlink leafygreen-ui-1kepx47" href="#troubleshoot-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="troubleshoot-replica-sets"> </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="#check-replica-set-status" target="_self"> <span> Check Replica Set Status </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#check-the-replication-lag" target="_self"> <span> Check the Replication Lag </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#slow-application-of-oplog-entries" target="_self"> <span> Slow Application of Oplog Entries </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#test-connections-between-all-members" target="_self"> <span> Test Connections Between all Members </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#socket-exceptions-when-rebooting-more-than-one-secondary" target="_self"> <span> Socket Exceptions when Rebooting More than One Secondary </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#check-the-size-of-the-oplog" target="_self"> <span> Check the Size of the Oplog </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> This section describes common strategies for troubleshooting <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> deployments. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-replica-set-troubleshooting-check-replication-status"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Check Replica Set Status <a class="headerlink leafygreen-ui-1kepx47" href="#check-replica-set-status" 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="check-replica-set-status"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To display the current state of the replica set and current state of each member, run the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> method in 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> session that is connected to the replica set's <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> . For descriptions of the information displayed by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetGetStatus/"> replSetGetStatus <!-- --> . </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"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> method is a wrapper that runs the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetGetStatus/#mongodb-dbcommand-dbcmd.replSetGetStatus"> <code class="leafygreen-ui-1l06pbn"> replSetGetStatus </code> </a> database command. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-replica-set-replication-lag"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Check the Replication Lag <a class="headerlink leafygreen-ui-1kepx47" href="#check-the-replication-lag" 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="check-the-replication-lag"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Replication lag is a delay between an operation on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> and the application of that operation from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondary </a> . Replication lag can be a significant issue and can seriously affect MongoDB <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> deployments. Excessive replication lag makes "lagged" members ineligible to quickly become primary and increases the possibility that distributed read operations will be inconsistent. </p> <p class="leafygreen-ui-1kp3ins"> To check the current length of replication lag: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In 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> session that is connected to the primary, call the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.printSecondaryReplicationInfo/#mongodb-method-rs.printSecondaryReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> rs.printSecondaryReplicationInfo() </code> </a> method. </p> <p class="leafygreen-ui-1kp3ins"> Returns the <code class="leafygreen-ui-1l06pbn"> syncedTo </code> value for each member, which shows the time when the last oplog entry was written to the secondary, as shown in the following example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"source: m1.example.net:27017\n syncedTo: Thu Apr 10 2014 10:27:47 GMT-0400 (EDT)\n 0 secs (0 hrs) behind the primary\nsource: m2.example.net:27017\n syncedTo: Thu Apr 10 2014 10:27:47 GMT-0400 (EDT)\n 0 secs (0 hrs) behind the primary"} </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">source: m1.example.net:27017</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> syncedTo: Thu Apr 10 2014 10:27:47 GMT-0400 (EDT)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> 0 secs (0 hrs) behind the primary</td></tr><tr class=""><td class="leafygreen-ui-7razhx">source: m2.example.net:27017</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> syncedTo: Thu Apr 10 2014 10:27:47 GMT-0400 (EDT)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> 0 secs (0 hrs) behind the primary</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"> A <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-delayed-member/#std-label-replica-set-delayed-members"> delayed member </a> may show as <code class="leafygreen-ui-1l06pbn"> 0 </code> seconds behind the primary when the inactivity period on the primary is greater than the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-.secondaryDelaySecs"> <code class="leafygreen-ui-1l06pbn"> members[n].secondaryDelaySecs </code> </a> value. </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"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> method is a wrapper around the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetGetStatus/#mongodb-dbcommand-dbcmd.replSetGetStatus"> <code class="leafygreen-ui-1l06pbn"> replSetGetStatus </code> </a> database command. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 7.0 (and 6.0.13, 5.0.24), the <code class="leafygreen-ui-1l06pbn"> totalOplogSlotDurationMicros </code> in the slow query log message shows the time between a write operation getting a commit timestamp to commit the storage engine writes and actually committing. <code class="leafygreen-ui-1l06pbn"> mongod </code> supports parallel writes. However, it commits write operations with commit timestamps in any order. </p> <div class="leafygreen-ui-vg7qwp" role="note"> <h2 class="leafygreen-ui-2xicti"> Example </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Consider the following writes with commit timestamps: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> writeA with Timestamp1 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> writeB with Timestamp2 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> writeC with Timestamp3 </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Suppose writeB commits first at Timestamp2. Replication is paused until writeA commits because writeA's oplog entry with Timestamp1 is required for replication to copy the oplog to secondary replica set members. </p> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Monitor the rate of replication by checking for non-zero or increasing oplog time values in the <span class="guilabel css-h15tq0"> Replication Lag </span> graph available in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://docs.cloudmanager.mongodb.com/reference/alerts/replication-lag/" target="_self"> <span> Cloud Manager </span> </a> and in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://docs.opsmanager.mongodb.com/current/reference/alerts/replication-lag/" target="_self"> <span> Ops Manager </span> </a> . </p> </li> </ul> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Replication Lag Causes <a class="headerlink leafygreen-ui-1kepx47" href="#replication-lag-causes" 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="replication-lag-causes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Possible causes of replication lag include: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> Network Latency </strong> </p> <p class="leafygreen-ui-1kp3ins"> Check the network routes between the members of your set to ensure that there is no packet loss or network routing issue. </p> <p class="leafygreen-ui-1kp3ins"> Use tools including <code class="leafygreen-ui-1l06pbn"> ping </code> to test latency between set members and <code class="leafygreen-ui-1l06pbn"> traceroute </code> to expose the routing of packets network endpoints. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> Disk Throughput </strong> </p> <p class="leafygreen-ui-1kp3ins"> If the file system and disk device on the secondary is unable to flush data to disk as quickly as the primary, then the secondary will have difficulty keeping state. Disk-related issues are incredibly prevalent on multi-tenant systems, including virtualized instances, and can be transient if the system accesses disk devices over an IP network (as is the case with Amazon's EBS system.) </p> <p class="leafygreen-ui-1kp3ins"> Use system-level tools to assess disk status, including <code class="leafygreen-ui-1l06pbn"> iostat </code> or <code class="leafygreen-ui-1l06pbn"> vmstat </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> Concurrency </strong> </p> <p class="leafygreen-ui-1kp3ins"> In some cases, long-running operations on the primary can block replication on secondaries. For best results, configure <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-w"> write concern </a> to require confirmation of replication to secondaries. This prevents write operations from returning if replication cannot keep up with the write load. </p> <p class="leafygreen-ui-1kp3ins"> You can also use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-database-profiler"> database profiler </a> to see if there are slow queries or long-running operations that correspond to the incidences of lag. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> Appropriate Write Concern </strong> </p> <p class="leafygreen-ui-1kp3ins"> If you are performing a large data ingestion or bulk load operation that requires a large number of writes to the primary, particularly with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-number-"> <code class="leafygreen-ui-1l06pbn"> unacknowledged write concern </code> </a> , the secondaries will not be able to read the oplog fast enough to keep up with changes. </p> <p class="leafygreen-ui-1kp3ins"> To prevent this, request <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/"> write acknowledgment write concern </a> after every 100, 1,000, or another interval to provide an opportunity for secondaries to catch up with the primary. </p> <p class="leafygreen-ui-1kp3ins"> For more information see: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-w"> Write Concern </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/distributed-queries/#std-label-write-operations-replica-sets"> Replica Set Write Concern </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-oplog/#std-label-replica-set-oplog-sizing"> Oplog Size </a> </p> </li> </ul> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-flow-control"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Flow Control <a class="headerlink leafygreen-ui-1kepx47" href="#flow-control" 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="flow-control"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Administrators can limit the rate at which the primary applies its writes with the goal of keeping the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetGetStatus/#mongodb-data-replSetGetStatus.optimes.lastCommittedOpTime"> <code class="leafygreen-ui-1l06pbn"> majority committed </code> </a> lag under a configurable maximum value <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.flowControlTargetLagSeconds"> <code class="leafygreen-ui-1l06pbn"> flowControlTargetLagSeconds </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> By default, flow control is <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.enableFlowControl"> <code class="leafygreen-ui-1l06pbn"> enabled </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"> For flow control to engage, the replica set/sharded cluster must have: <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-view-fcv"> featureCompatibilityVersion (fCV) </a> of <code class="leafygreen-ui-1l06pbn"> 4.2 </code> and read concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.enableMajorityReadConcern"> <code class="leafygreen-ui-1l06pbn"> majority enabled </code> </a> . That is, enabled flow control has no effect if fCV is not <code class="leafygreen-ui-1l06pbn"> 4.2 </code> or if read concern majority is disabled. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> With flow control enabled, as the lag grows close to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.flowControlTargetLagSeconds"> <code class="leafygreen-ui-1l06pbn"> flowControlTargetLagSeconds </code> </a> , writes on the primary must obtain tickets before taking locks to apply writes. By limiting the number of tickets issued per second, the flow control mechanism attempts to keep the lag under the target. </p> <p class="leafygreen-ui-1kp3ins"> Replication lag can occur without the replica set receiving sufficient load to engage flow control, such as in the case of an unresponsive <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondary <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To view the status of flow control, run the following commands on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary <!-- --> : </a> </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Run the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.printSecondaryReplicationInfo/#mongodb-method-rs.printSecondaryReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> rs.printSecondaryReplicationInfo() </code> </a> method to determine if any nodes are lagging: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"rs.printSecondaryReplicationInfo()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">printSecondaryReplicationInfo</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"> Example output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"source: 192.0.2.2:27017\n{\n syncedTo: 'Mon Jan 31 2022 18:58:50 GMT+0000 (Coordinated Universal Time)',\n replLag: '0 secs (0 hrs) behind the primary '\n}\n---\nsource: 192.0.2.3:27017\n{\n syncedTo: 'Mon Jan 31 2022 18:58:05 GMT+0000 (Coordinated Universal Time)',\n replLag: '45 secs (0 hrs) behind the primary '\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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"><span class="lg-highlight-attr">source</span>: <span class="lg-highlight-number">192.0</span><span class="lg-highlight-number">.2</span><span class="lg-highlight-number">.2</span>:<span class="lg-highlight-number">27017</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">syncedTo</span>: <span class="lg-highlight-string">'Mon Jan 31 2022 18:58:50 GMT+0000 (Coordinated Universal Time)'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">replLag</span>: <span class="lg-highlight-string">'0 secs (0 hrs) behind the primary '</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">-<!-- -->-<!-- -->-</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">source</span>: <span class="lg-highlight-number">192.0</span><span class="lg-highlight-number">.2</span><span class="lg-highlight-number">.3</span>:<span class="lg-highlight-number">27017</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">syncedTo</span>: <span class="lg-highlight-string">'Mon Jan 31 2022 18:58:05 GMT+0000 (Coordinated Universal Time)'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">replLag</span>: <span class="lg-highlight-string">'45 secs (0 hrs) behind the primary '</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Run the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-dbcommand-dbcmd.serverStatus"> <code class="leafygreen-ui-1l06pbn"> serverStatus </code> </a> command and use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.flowControl.isLagged"> <code class="leafygreen-ui-1l06pbn"> flowControl.isLagged </code> </a> value to determine whether the replica set has engaged flow control: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand( { serverStatus: 1 } ).flowControl.isLagged","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-title lg-highlight-function">runCommand</span>( <!-- -->{ <span class="lg-highlight-attr">serverStatus</span>: <span class="lg-highlight-number">1</span> } ).<span class="lg-highlight-property">flowControl</span>.<span class="lg-highlight-property">isLagged</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"> Example output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"false","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-literal">false</span></td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If flow control has not engaged, investigate the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondary </a> to determine the cause of the replication lag, such as limitations in the hardware, network, or application. </p> </li> </ol> <p class="leafygreen-ui-1kp3ins"> For information on flow control statistics, see: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.flowControl"> <code class="leafygreen-ui-1l06pbn"> flowControl </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/currentOp/#mongodb-data--currentOp.waitingForFlowControl"> <code class="leafygreen-ui-1l06pbn"> $currentOp.waitingForFlowControl </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/currentOp/#mongodb-data--currentOp.flowControlStats"> <code class="leafygreen-ui-1l06pbn"> $currentOp.flowControlStats </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-data-currentOp.waitingForFlowControl"> <code class="leafygreen-ui-1l06pbn"> currentOp.waitingForFlowControl </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-data-currentOp.flowControlStats"> <code class="leafygreen-ui-1l06pbn"> currentOp.flowControlStats </code> </a> </p> </li> </ul> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Slow Application of Oplog Entries <a class="headerlink leafygreen-ui-1kepx47" href="#slow-application-of-oplog-entries" 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="slow-application-of-oplog-entries"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Secondary members of a replica set now <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-oplog/#std-label-slow-oplog-application"> log oplog entries </a> that take longer than the slow operation threshold to apply. These slow oplog messages: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Are logged for the secondaries in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--logpath"> <code class="leafygreen-ui-1l06pbn"> diagnostic log </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Are logged under the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#mongodb-data-REPL"> <code class="leafygreen-ui-1l06pbn"> REPL </code> </a> component with the text <code class="leafygreen-ui-1l06pbn"> applied op: &lt;oplog entry&gt; took &lt;num&gt;ms </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Do not depend on the log levels (either at the system or component level) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Do not depend on the profiling level. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Are affected by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-operationProfiling.slowOpSampleRate"> <code class="leafygreen-ui-1l06pbn"> slowOpSampleRate </code> . </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The profiler does not capture slow oplog entries. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-replica-set-troubleshooting-check-connection"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Test Connections Between all Members <a class="headerlink leafygreen-ui-1kepx47" href="#test-connections-between-all-members" 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="test-connections-between-all-members"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> All members of a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> must be able to connect to every other member of the set to support replication. Always verify connections in both "directions." Networking topologies and firewall configurations can prevent normal and required connectivity, which can block replication. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Before you bind your instance to a publicly-accessible IP address, you must secure your cluster from unauthorized access. For a complete list of security recommendations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-security-checklist"> Security Checklist for Self-Managed Deployments </a> . At minimum, consider <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-checklist-auth"> enabling authentication </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-hardening/#std-label-network-config-hardening"> hardening network infrastructure <!-- --> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB binaries, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , bind to localhost by default. If the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.ipv6"> <code class="leafygreen-ui-1l06pbn"> net.ipv6 </code> </a> configuration file setting or the <code class="leafygreen-ui-1l06pbn"> --ipv6 </code> command line option is set for the binary, the binary additionally binds to the localhost IPv6 address. </p> <p class="leafygreen-ui-1kp3ins"> By default <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> that are bound to localhost only accept connections from clients that are running on the same computer. This binding behavior includes <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 other members of your replica set or sharded cluster. Remote clients cannot connect to binaries that are bound only to localhost. </p> <p class="leafygreen-ui-1kp3ins"> To override the default binding and bind to other IP addresses, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> configuration file setting or the <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> command-line option to specify a list of hostnames or IP addresses. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Starting in MongDB 5.0, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/Split-horizon_DNS" rel="noopener noreferrer"> <span> split horizon DNS </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> nodes that are only configured with an IP address fail startup validation and report an error. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.disableSplitHorizonIPCheck"> <code class="leafygreen-ui-1l06pbn"> disableSplitHorizonIPCheck </code> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For example, the following <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance binds to both the localhost and the hostname <code class="leafygreen-ui-1l06pbn"> My-Example-Associated-Hostname </code> , which is associated with the IP address <code class="leafygreen-ui-1l06pbn"> 198.51.100.1 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --bind_ip localhost,My-Example-Associated-Hostname"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --bind_ip localhost,My-Example-Associated-Hostname</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"> In order to connect to this instance, remote clients must specify the hostname or its associated IP address <code class="leafygreen-ui-1l06pbn"> 198.51.100.1 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh --host My-Example-Associated-Hostname\n\nmongosh --host 198.51.100.1"} </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">mongosh --host My-Example-Associated-Hostname</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongosh --host 198.51.100.1</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"> Consider the following example of a bidirectional test of networking: </p> <div class="leafygreen-ui-vg7qwp" role="note"> <h2 class="leafygreen-ui-2xicti"> Example </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Given a replica set with three members running on three separate hosts: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> m1.example.net </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> m2.example.net </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> m3.example.net </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> All three use the default port <code class="leafygreen-ui-1l06pbn"> 27017 </code> . </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Test the connection from <code class="leafygreen-ui-1l06pbn"> m1.example.net </code> to the other hosts with the following operation set <code class="leafygreen-ui-1l06pbn"> m1.example.net </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh --host m2.example.net --port 27017\n\nmongosh --host m3.example.net --port 27017","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">mongosh --host m2.example.net --port 27017</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongosh --host m3.example.net --port 27017</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Test the connection from <code class="leafygreen-ui-1l06pbn"> m2.example.net </code> to the other two hosts with the following operation set from <code class="leafygreen-ui-1l06pbn"> m2.example.net </code> , as in: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh --host m1.example.net --port 27017\n\nmongosh --host m3.example.net --port 27017","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">mongosh --host m1.example.net --port 27017</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongosh --host m3.example.net --port 27017</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"> You have now tested the connection between <code class="leafygreen-ui-1l06pbn"> m2.example.net </code> and <code class="leafygreen-ui-1l06pbn"> m1.example.net </code> in both directions. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Test the connection from <code class="leafygreen-ui-1l06pbn"> m3.example.net </code> to the other two hosts with the following operation set from the <code class="leafygreen-ui-1l06pbn"> m3.example.net </code> host, as in: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh --host m1.example.net --port 27017\n\nmongosh --host m2.example.net --port 27017","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">mongosh --host m1.example.net --port 27017</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongosh --host m2.example.net --port 27017</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ol> <p class="leafygreen-ui-1kp3ins"> If any connection, in any direction fails, check your networking and firewall configuration and reconfigure your environment to allow these connections. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Socket Exceptions when Rebooting More than One Secondary <a class="headerlink leafygreen-ui-1kepx47" href="#socket-exceptions-when-rebooting-more-than-one-secondary" 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="socket-exceptions-when-rebooting-more-than-one-secondary"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> When you reboot members of a replica set, ensure that the set is able to elect a primary during the maintenance. This means ensuring that a majority of the set's <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-.votes"> <code class="leafygreen-ui-1l06pbn"> members[n].votes </code> </a> are available. </p> <p class="leafygreen-ui-1kp3ins"> When a set's active members can no longer form a majority, the set's <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> steps down and becomes a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondary </a> . The primary does not close client connections when it steps down. </p> <p class="leafygreen-ui-1kp3ins"> Clients cannot write to the replica set until the members elect a new primary. </p> <div class="leafygreen-ui-vg7qwp" role="note"> <h2 class="leafygreen-ui-2xicti"> Example </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Given a three-member replica set where every member has one vote, the set can elect a primary if at least two members can connect to each other. If you reboot the two secondaries at once, the primary steps down and becomes a secondary. Until at least another secondary becomes available, i.e. at least one of the rebooted secondaries also becomes available, the set has no primary and cannot elect a new primary. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on votes, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-elections/"> Replica Set Elections </a> . For related information on connection errors, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/faq/diagnostics/#std-label-faq-keepalive"> Does TCP <code class="leafygreen-ui-1l06pbn"> keepalive </code> time affect MongoDB Deployments? <!-- --> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-replica-set-troubleshooting-check-oplog-size"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Check the Size of the Oplog <a class="headerlink leafygreen-ui-1kepx47" href="#check-the-size-of-the-oplog" 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="check-the-size-of-the-oplog"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A larger <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> can give a replica set a greater tolerance for lag, and make the set more resilient. </p> <p class="leafygreen-ui-1kp3ins"> To check the size of the oplog for a given <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> member, connect to the member 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 run the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.printReplicationInfo/#mongodb-method-rs.printReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> rs.printReplicationInfo() </code> </a> method. </p> <p class="leafygreen-ui-1kp3ins"> The output displays the size of the oplog and the date ranges of the operations contained in the oplog. In the following example, the oplog is about 10 MB and is able to fit about 26 hours (94400 seconds) of operations: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"configured oplog size: 10.10546875MB\nlog length start to end: 94400 (26.22hrs)\noplog first event time: Mon Mar 19 2012 13:50:38 GMT-0400 (EDT)\noplog last event time: Wed Oct 03 2012 14:59:10 GMT-0400 (EDT)\nnow: Wed Oct 03 2012 15:00:21 GMT-0400 (EDT)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">configured oplog <span class="lg-highlight-attr">size</span>: <span class="lg-highlight-number">10.</span>10546875MB</td></tr><tr class=""><td class="leafygreen-ui-7razhx">log length start to <span class="lg-highlight-attr">end</span>: <span class="lg-highlight-number">94400</span> <!-- -->(<span class="lg-highlight-number">26.</span>22hrs)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">oplog first event <span class="lg-highlight-attr">time</span>: <span class="lg-highlight-title lg-highlight-class">Mon</span> <span class="lg-highlight-title lg-highlight-class">Mar</span> <span class="lg-highlight-number">19</span> <span class="lg-highlight-number">2012</span> <span class="lg-highlight-number">13</span>:<span class="lg-highlight-number">50</span>:<span class="lg-highlight-number">38</span> <span class="lg-highlight-variable lg-highlight-constant">GMT</span>-<span class="lg-highlight-number">0400</span> <!-- -->(<span class="lg-highlight-variable lg-highlight-constant">EDT</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">oplog last event <span class="lg-highlight-attr">time</span>: <span class="lg-highlight-title lg-highlight-class">Wed</span> <span class="lg-highlight-title lg-highlight-class">Oct</span> <span class="lg-highlight-number">03</span> <span class="lg-highlight-number">2012</span> <span class="lg-highlight-number">14</span>:<span class="lg-highlight-number">59</span>:<span class="lg-highlight-number">10</span> <span class="lg-highlight-variable lg-highlight-constant">GMT</span>-<span class="lg-highlight-number">0400</span> <!-- -->(<span class="lg-highlight-variable lg-highlight-constant">EDT</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">now</span>: <span class="lg-highlight-title lg-highlight-class">Wed</span> <span class="lg-highlight-title lg-highlight-class">Oct</span> <span class="lg-highlight-number">03</span> <span class="lg-highlight-number">2012</span> <span class="lg-highlight-number">15</span>:<span class="lg-highlight-number">00</span>:<span class="lg-highlight-number">21</span> <span class="lg-highlight-variable lg-highlight-constant">GMT</span>-<span class="lg-highlight-number">0400</span> <!-- -->(<span class="lg-highlight-variable lg-highlight-constant">EDT</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 oplog should be long enough to hold all transactions for the longest downtime you expect on a secondary. <a class="footnote-reference header-buffer" href="#footnote-oplog" id="ref-oplog-id1"> [ <!-- --> 1 <!-- --> ] </a> At a minimum, an oplog should be able to hold minimum 24 hours of operations; however, many users prefer to have 72 hours or even a week's work of operations. </p> <p class="leafygreen-ui-1kp3ins"> For more information on how oplog size affects operations, see: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-oplog/#std-label-replica-set-oplog-sizing"> Oplog Size <!-- --> , </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-delayed-member/#std-label-replica-set-delayed-members"> Delayed Replica Set Members </a> , and </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-replica-set-replication-lag" target="_self"> <span> Check the Replication Lag <!-- --> . </span> </a> </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You normally want the oplog to be the same size on all members. If you resize the oplog, resize it on all members. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> To change oplog size, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/change-oplog-size/"> Change the Oplog Size of Self-Managed Replica Set Members </a> tutorial. </p> <table class="header-buffer leafygreen-ui-rbqgrl" frame="void" id="footnote-oplog" rules="none"> <colgroup> <col/> </colgroup> <tbody valign="top"> <tr> <td class="leafygreen-ui-17r2xs0"> [ <a href="#ref-oplog-id1"> 1 </a> ] </td> <td class="leafygreen-ui-17r2xs0"> <!-- --> The oplog can grow past its configured size limit to avoid deleting the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetGetStatus/#mongodb-data-replSetGetStatus.optimes.lastCommittedOpTime"> <code class="leafygreen-ui-1l06pbn"> majority commit point </code> . </a> </td> </tr> </tbody> </table> </section> </section>
https://www.mongodb.com/docs/manual/core/indexes/index-types/index-text/specify-language-text-index/create-text-index-multiple-languages/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Create a Text Index for a Collection Containing Multiple Languages on Self-Managed Deployments <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-text-index-for-a-collection-containing-multiple-languages-on-self-managed-deployments" 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-text-index-for-a-collection-containing-multiple-languages-on-self-managed-deployments"> </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="#before-you-begin" target="_self"> <span> Before You Begin </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#procedure" target="_self"> <span> Procedure </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#results" target="_self"> <span> Results </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> <p class="leafygreen-ui-1kp3ins"> You can create a text index to improve the performance of text search queries run on a collection containing documents or embedded documents with text in multiple languages. </p> <p class="leafygreen-ui-1kp3ins"> If a collection contains documents or embedded documents that are in multiple different languages, include a field named <code class="leafygreen-ui-1l06pbn"> language </code> and specify the language for those documents as the field value. To see the languages available for text indexing, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/text-search-languages/#std-label-text-search-languages"> Text Search Languages on Self-Managed Deployments <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Your insert operation should resemble this example to support text indexing for multiple languages: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.&lt;collection&gt;.insertOne(\n {\n &lt;field&gt;: &lt;value&gt;,\n language: &lt;language&gt;\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<!-- -->&lt;<!-- -->collection<!-- -->&gt;<!-- -->.<span class="lg-highlight-title lg-highlight-function">insertOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;<!-- -->field<!-- -->&gt;<!-- -->: &lt;<!-- -->value<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">language</span>: &lt;<!-- -->language<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Before You Begin <a class="headerlink leafygreen-ui-1kepx47" href="#before-you-begin" 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="before-you-begin"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Create a <code class="leafygreen-ui-1l06pbn"> quotes </code> collection that contains multi-language documents that include the <code class="leafygreen-ui-1l06pbn"> language </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.quotes.insertMany(\n {\n _id: 1,\n language: \"portuguese\",\n original: \"A sorte protege os audazes.\",\n translation:\n [\n {\n language: \"english\",\n quote: \"Fortune favors the bold.\"\n },\n {\n language: \"spanish\",\n quote: \"La suerte protege a los audaces.\"\n }\n ]\n },\n {\n _id: 2,\n language: \"spanish\",\n original: \"Nada hay más surrealista que la realidad.\",\n translation:\n [\n {\n language: \"english\",\n quote: \"There is nothing more surreal than reality.\"\n },\n {\n language: \"french\",\n quote: \"Il n'y a rien de plus surréaliste que la réalité.\"\n }\n ]\n },\n {\n _id: 3,\n original: \"Is this a dagger which I see before me?\",\n translation:\n {\n language: \"spanish\",\n quote: \"Es este un puñal que veo delante de mí.\"\n }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">quotes</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">language</span>: <span class="lg-highlight-string">"portuguese"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">original</span>: <span class="lg-highlight-string">"A sorte protege os audazes."</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">translation</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">language</span>: <span class="lg-highlight-string">"english"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quote</span>: <span class="lg-highlight-string">"Fortune favors the bold."</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">language</span>: <span class="lg-highlight-string">"spanish"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quote</span>: <span class="lg-highlight-string">"La suerte protege a los audaces."</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">language</span>: <span class="lg-highlight-string">"spanish"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">original</span>: <span class="lg-highlight-string">"Nada hay más surrealista que la realidad."</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">translation</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">language</span>: <span class="lg-highlight-string">"english"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quote</span>: <span class="lg-highlight-string">"There is nothing more surreal than reality."</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">language</span>: <span class="lg-highlight-string">"french"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quote</span>: <span class="lg-highlight-string">"Il n'y a rien de plus surréaliste que la réalité."</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">original</span>: <span class="lg-highlight-string">"Is this a dagger which I see before me?"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">translation</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">language</span>: <span class="lg-highlight-string">"spanish"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quote</span>: <span class="lg-highlight-string">"Es este un puñal que veo delante de mí."</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#procedure" 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="procedure"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following operation creates a text index on the <code class="leafygreen-ui-1l06pbn"> original </code> and <code class="leafygreen-ui-1l06pbn"> translation.quote </code> fields: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.quotes.createIndex({ original: \"text\", \"translation.quote\": \"text\", \"default_language\" : \"fr\" })","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">quotes</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>(<!-- -->{ <span class="lg-highlight-attr">original</span>: <span class="lg-highlight-string">"text"</span>, <span class="lg-highlight-string">"translation.quote"</span>: <span class="lg-highlight-string">"text"</span>, <span class="lg-highlight-string">"default_language"</span> <!-- -->: <span class="lg-highlight-string">"fr"</span> })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> English is the default language for indexes. If you do not specify the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createIndexes/#std-label-createIndexes-default-language"> default_language </a> , your query must specify the language with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/text/#std-label-language-field"> $language </a> parameter. For more information, refer to <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/specify-text-index-language/#std-label-specify-default-text-index-language"> Specify the Default Language for a Text Index on Self-Managed Deployments <!-- --> . </a> </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Results <a class="headerlink leafygreen-ui-1kepx47" href="#results" 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="results"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The resulting index supports text search queries for the documents and embedded documents containing the <code class="leafygreen-ui-1l06pbn"> original </code> and <code class="leafygreen-ui-1l06pbn"> translation.quote </code> fields. The text index follows different suffix stemming rules, and ignores stop words specific to each language, based on the value in the <code class="leafygreen-ui-1l06pbn"> language </code> field. </p> <p class="leafygreen-ui-1kp3ins"> For example, the following query searches for the <code class="leafygreen-ui-1l06pbn"> french </code> word <code class="leafygreen-ui-1l06pbn"> réalité </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.quotes.find(\n { $text:\n { $search: \"réalité\" }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">quotes</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$text</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$search</span>: <span class="lg-highlight-string">"réalité"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n {\n _id: 2,\n language: 'spanish',\n original: 'Nada hay más surrealista que la realidad.',\n translation: [\n {\n language: 'english',\n quote: 'There is nothing more surreal than reality.'\n },\n {\n language: 'french',\n quote: \"Il n'y a rien de plus surréaliste que la réalité.\"\n }\n ]\n }\n]","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">language</span>: <span class="lg-highlight-string">'spanish'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">original</span>: <span class="lg-highlight-string">'Nada hay más surrealista que la realidad.'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">translation</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">language</span>: <span class="lg-highlight-string">'english'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quote</span>: <span class="lg-highlight-string">'There is nothing more surreal than reality.'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">language</span>: <span class="lg-highlight-string">'french'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quote</span>: <span class="lg-highlight-string">"Il n'y a rien de plus surréaliste que la réalité."</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For embedded documents that do not contain the <code class="leafygreen-ui-1l06pbn"> language </code> field, </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the enclosing document contains the <code class="leafygreen-ui-1l06pbn"> language </code> field, then the index uses the document's language for the embedded documents. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Otherwise, the index uses the default language for the embedded documents. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For documents that do not contain the <code class="leafygreen-ui-1l06pbn"> language </code> field, the index uses the default language, which is English. </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> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To specify the text index language in a field other than <code class="leafygreen-ui-1l06pbn"> language </code> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/specify-language-text-index/use-any-field-to-specify-language/#std-label-text-index-specify-language-in-field"> Use Any Field to Specify Text Index Language on Self-Managed Deployments <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To learn how to specify the default language for a text index, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/specify-text-index-language/#std-label-specify-default-text-index-language"> Specify the Default Language for a Text Index on Self-Managed Deployments <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To learn about other text index properties, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/text-index-properties/#std-label-text-index-properties"> Text Index Properties on Self-Managed Deployments <!-- --> . </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/db.collection.findOne/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.collection.findOne() <a class="headerlink leafygreen-ui-1kepx47" href="#db.collection.findone--" 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.collection.findone--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <div class="leafygreen-ui-147elvs"> <p class="leafygreen-ui-1ronz74"> MongoDB with drivers </p> <div class="leafygreen-ui-18k5rfm"> <p class="leafygreen-ui-1kp3ins"> This page documents 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> method. To see the equivalent method in a MongoDB driver, see the corresponding page for your programming language: </p> </div> <div class="leafygreen-ui-zgrwqu notranslate"> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/drivers/csharp/current/fundamentals/crud/read-operations/retrieve/#find-one-document" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_1351_59964)"> <g clip-path="url(#clip1_1351_59964)"> <path d="M25.7709 9.2495C25.7709 8.79827 25.678 8.39408 25.4827 8.04627C25.2874 7.70785 25.0084 7.42586 24.627 7.20025C21.465 5.35781 18.2937 3.51538 15.1317 1.67295C14.2761 1.17474 13.4484 1.19354 12.6021 1.70115C11.3466 2.45316 5.04112 6.10042 3.15321 7.20025C2.3813 7.65142 2 8.34705 2 9.24005C2 12.9531 2 16.6568 2 20.3698C2 20.8117 2.093 21.2064 2.279 21.5449C2.4743 21.8927 2.7626 22.1841 3.15321 22.4191C5.03182 23.5189 11.3373 27.1662 12.6021 27.9182C13.4484 28.4258 14.2761 28.4446 15.1317 27.9463C18.2937 26.1039 21.465 24.2615 24.627 22.4191C25.0177 22.1935 25.306 21.9021 25.5012 21.5449C25.6873 21.2064 25.7803 20.8117 25.7803 20.3698C25.7709 20.3698 25.7709 12.9531 25.7709 9.2495Z" fill="#A179DC"> </path> <path d="M13.9227 14.7673L2.27905 21.5449C2.47435 21.8927 2.76265 22.1841 3.15326 22.4191C5.03187 23.5189 11.3373 27.1662 12.6021 27.9182C13.4484 28.4258 14.2762 28.4445 15.1317 27.9463C18.2938 26.1039 21.4651 24.2615 24.6271 22.4191C25.0177 22.1935 25.306 21.9021 25.5013 21.5449L13.9227 14.7673Z" fill="#280068"> </path> <path d="M25.7711 9.24949C25.7711 8.79827 25.6781 8.39408 25.4828 8.04626L13.9229 14.7768L25.4921 21.5543C25.6781 21.2159 25.7711 20.8211 25.7711 20.3793C25.7711 20.3699 25.7711 12.9531 25.7711 9.24949Z" fill="#390091"> </path> <path d="M20.7771 12.2387V13.5078H22.0325V12.2387H22.6557V13.5078H23.9111V14.1376H22.6557V15.4066H23.9111V16.0364H22.6557V17.3054H22.0325V16.0364H20.7771V17.3054H20.1539V16.0364H18.8984V15.4066H20.1539V14.1376H18.8984V13.5078H20.1539V12.2387H20.7771ZM22.0325 14.1376H20.7771V15.4066H22.0325V14.1376Z" fill="white"> </path> <path d="M13.9508 5.87482C17.2151 5.87482 20.0702 7.67022 21.6047 10.3399L21.5861 10.3117L17.7452 12.5489C16.9919 11.2517 15.5969 10.3775 14.0066 10.3587H13.9601C11.5328 10.3587 9.56116 12.3515 9.56116 14.805C9.56116 15.604 9.77503 16.3654 10.1377 17.014C10.9004 18.3488 12.3232 19.2512 13.9601 19.2512C15.6062 19.2512 17.0384 18.3394 17.7917 16.9858L17.7731 17.014L21.614 19.2606C20.0981 21.9021 17.2895 23.6975 14.0531 23.7257H13.9508C10.6679 23.7257 7.81274 21.9209 6.28753 19.2418C5.54353 17.9352 5.11572 16.4124 5.11572 14.7956C5.11572 9.87931 9.06825 5.87482 13.9508 5.87482Z" fill="white"> </path> </g> </g> <defs> <clippath id="clip0_1351_59964"> <rect fill="white" height="28" transform="translate(0 0.809265)" width="28"> </rect> </clippath> <clippath id="clip1_1351_59964"> <rect fill="white" height="27" transform="translate(2 1.30966)" width="24"> </rect> </clippath> </defs> </svg> <span> C# </span> </a> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/drivers/java/sync/current/usage-examples/findOne/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 30 41" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M10.0921 30.7949C10.0921 30.7949 8.57608 31.6793 11.166 31.9636C14.2929 32.311 15.9037 32.2794 19.3464 31.6161C19.3464 31.6161 20.2623 32.1846 21.5257 32.6901C13.7876 35.9748 4.02791 32.5005 10.0921 30.7949Z" fill="#0074BD"> </path> <path d="M9.14539 26.4678C9.14539 26.4678 7.43985 27.7312 10.0298 27.9838C13.3778 28.3312 15.9992 28.3628 20.579 27.4785C20.579 27.4785 21.2107 28.1101 22.1898 28.4576C12.8724 31.2054 2.44949 28.6787 9.14539 26.4678Z" fill="#0074BD"> </path> <path d="M17.1039 19.1398C18.9989 21.3191 16.5985 23.3089 16.5985 23.3089C16.5985 23.3089 21.431 20.8138 19.2201 17.6869C17.1355 14.7811 15.5563 13.3282 24.1788 8.33789C24.1473 8.33789 10.6607 11.6858 17.1039 19.1398Z" fill="#EA2D2E"> </path> <path d="M27.3377 33.9845C27.3377 33.9845 28.4431 34.9004 26.1059 35.6269C21.6525 36.985 7.53417 37.3957 3.61769 35.6901C2.19639 35.0899 4.84949 34.2372 5.67069 34.0477C6.52347 33.8582 7.02884 33.8898 7.02884 33.8898C5.44961 32.7843 -3.10981 36.0691 2.67016 36.9851C18.4308 39.5433 31.4121 35.8164 27.3377 33.9845Z" fill="#0074BD"> </path> <path d="M10.8194 21.983C10.8194 21.983 3.6497 23.6885 8.2926 24.3203C10.2509 24.5729 14.1357 24.5097 17.7995 24.2255C20.7685 23.9728 23.7375 23.4359 23.7375 23.4359C23.7375 23.4359 22.6951 23.8781 21.9372 24.415C14.6411 26.3416 0.585992 25.4257 4.62881 23.4675C8.00839 21.7935 10.8194 21.983 10.8194 21.983Z" fill="#0074BD"> </path> <path d="M23.6745 29.1846C31.0969 25.3313 27.6542 21.6359 25.2538 22.1413C24.6537 22.2676 24.401 22.3623 24.401 22.3623C24.401 22.3623 24.6221 22.0149 25.0327 21.8886C29.7703 20.2146 33.4025 26.7842 23.5166 29.4057C23.5482 29.3741 23.6429 29.2794 23.6745 29.1846Z" fill="#0074BD"> </path> <path d="M19.2206 0.25293C19.2206 0.25293 23.3266 4.35891 15.3357 10.6758C8.92404 15.7293 13.8828 18.6351 15.3357 21.9199C11.6087 18.5403 8.86088 15.5714 10.6928 12.792C13.3775 8.74919 20.863 6.79093 19.2206 0.25293Z" fill="#EA2D2E"> </path> <path d="M11.5455 39.6068C18.6521 40.049 29.5803 39.3541 29.833 35.9746C29.833 35.9746 29.3276 37.238 23.9583 38.2487C17.894 39.3858 10.4085 39.2594 5.95508 38.533C5.95508 38.5646 6.87103 39.3225 11.5455 39.6068Z" fill="#0074BD"> </path> </svg> <span> Java Sync </span> </a> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/drivers/node/current/usage-examples/findOne/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 30 30" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:R2dtlqcmqn9:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":R2dtlqcmqn9:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":R2dtlqcmqn9:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":R2dtlqcmqn9:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <span> Node.js </span> </a> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/languages/python/pymongo-driver/current/read/retrieve/#find-one-document" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 111.6 147" width="24" xmlns="http://www.w3.org/2000/svg"> <lineargradient gradienttransform="matrix(.5625 0 0 -.568 -160.323 -146.09)" gradientunits="userSpaceOnUse" id=":R2htlqcmqn9:aa" x1="280.848" x2="389.865" y1="-268.463" y2="-362.257"> <stop offset="0" stop-color="#5a9fd4"> </stop> <stop offset="1" stop-color="#306998"> </stop> </lineargradient> <path d="M55.3 3.2c-4.6 0-9 .4-12.8 1.1-11.3 2-13.4 6.2-13.4 13.9v10.2h26.8v3.4H19c-7.8 0-14.6 4.7-16.8 13.6C-.3 55.6-.4 62 2.2 72.7c1.9 7.9 6.5 13.6 14.2 13.6h9.2V74c0-8.8 7.7-16.7 16.7-16.7h26.8c7.5 0 13.4-6.1 13.4-13.6V18.2c0-7.3-6.1-12.7-13.4-13.9-4.4-.8-9.2-1.1-13.8-1.1zm-14.5 8.2c2.8 0 5 2.3 5 5.1s-2.3 5.1-5 5.1c-2.8 0-5-2.3-5-5.1s2.2-5.1 5-5.1z" fill="url(#:R2htlqcmqn9:aa)"> </path> <lineargradient gradienttransform="matrix(.5625 0 0 -.568 -160.323 -146.09)" gradientunits="userSpaceOnUse" id=":R2htlqcmqn9:bb" x1="432.011" x2="393.081" y1="-419.025" y2="-363.946"> <stop offset="0" stop-color="#ffd43b"> </stop> <stop offset="1" stop-color="#ffe873"> </stop> </lineargradient> <path d="M86 31.8v11.9c0 9.2-7.8 17-16.8 17H42.5c-7.3 0-13.4 6.3-13.4 13.6v25.5c0 7.3 6.3 11.5 13.4 13.6 8.5 2.5 16.6 2.9 26.8 0 6.8-2 13.4-5.9 13.4-13.6V89.7H55.9v-3.4h40.2c7.8 0 10.7-5.4 13.4-13.6 2.8-8.4 2.7-16.5 0-27.3-1.9-7.8-5.6-13.6-13.4-13.6H86zM71 96.5c2.8 0 5 2.3 5 5.1s-2.3 5.1-5 5.1c-2.8 0-5-2.3-5-5.1-.1-2.8 2.2-5.1 5-5.1z" fill="url(#:R2htlqcmqn9:bb)"> </path> <radialgradient cx="-2274.721" cy="144.526" gradienttransform="matrix(0 -.2399 -1.0547 0 208.637 -414.922)" gradientunits="userSpaceOnUse" id=":R2htlqcmqn9:cc" r="29.037"> <stop offset="0" stop-color="#b8b8b8" stop-opacity=".498"> </stop> <stop offset="1" stop-color="#7f7f7f" stop-opacity="0"> </stop> </radialgradient> <path d="M92.1 130.9c0 3.8-16.1 7-35.9 7s-35.9-3.1-35.9-7c0-3.8 16.1-7 35.9-7s35.9 3.1 35.9 7z" fill="url(#:R2htlqcmqn9:cc)" opacity=".444"> </path> </svg> <span> PyMongo </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://mongoc.org/libmongoc/current/mongoc_collection_find_with_opts.html" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_1351_59955)"> <g clip-path="url(#clip1_1351_59955)"> <path clip-rule="evenodd" d="M13.118 1.49532C13.5403 1.25103 14.0559 1.25103 14.4783 1.49532C16.5652 2.70389 22.8385 6.34889 24.9193 7.55748C25.3416 7.80172 25.6025 8.25176 25.6025 8.74672C25.6025 11.1703 25.6025 18.4539 25.6025 20.8774C25.6025 21.366 25.3416 21.8224 24.9193 22.0667C22.8385 23.2753 16.5652 26.9203 14.4783 28.1289C14.0559 28.3732 13.5403 28.3732 13.118 28.1289C11.0373 26.9139 4.76398 23.2689 2.68323 22.0603C2.26087 21.816 2 21.366 2 20.871C2 18.4474 2 11.1639 2 8.7403C2 8.25176 2.26087 7.7953 2.68323 7.55106C4.76398 6.34889 11.0373 2.70389 13.118 1.49532Z" fill="#004482" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M2.18634 21.4946C2.01863 21.2632 2 21.051 2 20.7553C2 18.351 2 11.1061 2 8.70176C2 8.21317 2.26087 7.76319 2.67702 7.51889C4.75776 6.31675 11.0062 2.69104 13.0807 1.4889C13.5031 1.24461 14.0683 1.25104 14.4907 1.49533C16.5652 2.69747 22.795 6.29104 24.8696 7.49319C25.0373 7.58963 25.1677 7.70535 25.2795 7.86606L2.18634 21.4946Z" fill="#659AD2" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M13.8011 5.8089C18.6024 5.8089 22.4968 9.83964 22.4968 14.8089C22.4968 19.7782 18.6024 23.8089 13.8011 23.8089C8.99986 23.8089 5.10547 19.7782 5.10547 14.8089C5.10547 9.83964 8.99986 5.8089 13.8011 5.8089ZM13.8011 10.3089C16.1987 10.3089 18.1489 12.3275 18.1489 14.8089C18.1489 17.2903 16.1987 19.3089 13.8011 19.3089C11.4036 19.3089 9.4533 17.2903 9.4533 14.8089C9.4533 12.3275 11.4036 10.3089 13.8011 10.3089Z" fill="white" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M25.2857 7.87247C25.6087 8.18102 25.6025 8.65034 25.6025 9.01673C25.6025 11.4596 25.5839 18.396 25.6087 20.8325C25.6087 21.0896 25.528 21.3532 25.4099 21.5589L13.5466 14.8089L25.2857 7.87247Z" fill="#00599C" fill-rule="evenodd"> </path> </g> </g> <defs> <clippath id="clip0_1351_59955"> <rect fill="white" height="28" transform="translate(0 0.809265)" width="28"> </rect> </clippath> <clippath id="clip1_1351_59955"> <rect fill="white" height="27" transform="translate(2 1.30887)" width="24"> </rect> </clippath> </defs> </svg> <span> C </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/languages/cpp/cpp-driver/upcoming/read/retrieve/#find-one-document" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_1351_59959)"> <g clip-path="url(#clip1_1351_59959)"> <path d="M25.4013 21.5646C25.5872 21.2353 25.7034 20.8745 25.7034 20.5373V9.08012C25.7034 8.75078 25.5872 8.38217 25.4013 8.05283L13.8516 14.8127L25.4013 21.5646Z" fill="#00599C"> </path> <path d="M14.8738 28.0657L24.6729 22.3411C24.9517 22.1764 25.2151 21.8941 25.401 21.5647L13.8513 14.8127L2.30151 21.5647C2.48743 21.8941 2.74305 22.1764 3.02967 22.3411L12.8288 28.0657C13.3865 28.3951 14.316 28.3951 14.8738 28.0657Z" fill="#004482"> </path> <path d="M25.4011 8.06086C25.2152 7.73146 24.9596 7.44915 24.673 7.2845L14.8739 1.55983C14.3084 1.23046 13.3866 1.23046 12.8211 1.55983L3.02202 7.2845C2.46429 7.61385 1.99951 8.42158 1.99951 9.08033V20.5375C1.99951 20.8669 2.11571 21.2354 2.30162 21.5647L13.8514 14.8128L25.4011 8.06086Z" fill="#659AD2"> </path> <path d="M13.8512 22.8115C9.49778 22.8115 5.94995 19.2199 5.94995 14.8127C5.94995 10.4055 9.49778 6.81387 13.8512 6.81387C16.6631 6.81387 19.2813 8.34305 20.6912 10.8133L17.2751 12.813C16.5701 11.5818 15.261 10.8133 13.8512 10.8133C11.6745 10.8133 9.90055 12.6091 9.90055 14.8127C9.90055 17.0163 11.6745 18.8121 13.8512 18.8121C15.261 18.8121 16.5701 18.0436 17.2751 16.8124L20.6912 18.8121C19.2813 21.2745 16.6631 22.8115 13.8512 22.8115Z" fill="white"> </path> <path d="M21.7524 14.3657H20.8771V13.4796H19.994V14.3657H19.1187V15.2518H19.994V16.1458H20.8771V15.2518H21.7524V14.3657Z" fill="white"> </path> <path d="M25.0446 14.3657H24.1693V13.4796H23.2862V14.3657H22.4109V15.2518H23.2862V16.1458H24.1693V15.2518H25.0446V14.3657Z" fill="white"> </path> </g> </g> <defs> <clippath id="clip0_1351_59959"> <rect fill="white" height="28" transform="translate(0 0.809265)" width="28"> </rect> </clippath> <clippath id="clip1_1351_59959"> <rect fill="white" height="27" transform="translate(1.99951 1.30878)" width="24"> </rect> </clippath> </defs> </svg> <span> C++ </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/drivers/go/current/fundamentals/crud/read-operations/retrieve/#find-one-document" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" id="Layer_1" style="fill:#00ACD7" version="1.1" viewbox="0 0 205.4 76.7" width="24" x="0" xmlns="http://www.w3.org/2000/svg" y="0"> <path class="st00" d="M15.5 23.2c-.4 0-.5-.2-.3-.5l2.1-2.7c.2-.3.7-.5 1.1-.5h35.7c.4 0 .5.3.3.6l-1.7 2.6c-.2.3-.7.6-1 .6l-36.2-.1zM.4 32.4c-.4 0-.5-.2-.3-.5l2.1-2.7c.2-.3.7-.5 1.1-.5h45.6c.4 0 .6.3.5.6l-.8 2.4c-.1.4-.5.6-.9.6l-47.3.1zM24.6 41.6c-.4 0-.5-.3-.3-.6l1.4-2.5c.2-.3.6-.6 1-.6h20c.4 0 .6.3.6.7l-.2 2.4c0 .4-.4.7-.7.7l-21.8-.1z"> </path> <g id="CXHf1q_3_"> <path class="st00" d="M128.4 21.4c-6.3 1.6-10.6 2.8-16.8 4.4-1.5.4-1.6.5-2.9-1-1.5-1.7-2.6-2.8-4.7-3.8-6.3-3.1-12.4-2.2-18.1 1.5-6.8 4.4-10.3 10.9-10.2 19 .1 8 5.6 14.6 13.5 15.7 6.8.9 12.5-1.5 17-6.6.9-1.1 1.7-2.3 2.7-3.7H89.6c-2.1 0-2.6-1.3-1.9-3 1.3-3.1 3.7-8.3 5.1-10.9.3-.6 1-1.6 2.5-1.6h36.4c-.2 2.7-.2 5.4-.6 8.1-1.1 7.2-3.8 13.8-8.2 19.6-7.2 9.5-16.6 15.4-28.5 17-9.8 1.3-18.9-.6-26.9-6.6-7.4-5.6-11.6-13-12.7-22.2-1.3-10.9 1.9-20.7 8.5-29.3C70.4 8.7 79.8 2.8 91.3.7c9.4-1.7 18.4-.6 26.5 4.9 5.3 3.5 9.1 8.3 11.6 14.1.6.9.2 1.4-1 1.7z"> </path> <path class="st00" d="M161.5 76.7c-9.1-.2-17.4-2.8-24.4-8.8-5.9-5.1-9.6-11.6-10.8-19.3-1.8-11.3 1.3-21.3 8.1-30.2 7.3-9.6 16.1-14.6 28-16.7 10.2-1.8 19.8-.8 28.5 5.1 7.9 5.4 12.8 12.7 14.1 22.3 1.7 13.5-2.2 24.5-11.5 33.9-6.6 6.7-14.7 10.9-24 12.8-2.7.5-5.4.6-8 .9zm23.8-40.4c-.1-1.3-.1-2.3-.3-3.3-1.8-9.9-10.9-15.5-20.4-13.3-9.3 2.1-15.3 8-17.5 17.4-1.8 7.8 2 15.7 9.2 18.9 5.5 2.4 11 2.1 16.3-.6 7.9-4.1 12.2-10.5 12.7-19.1z"> </path> </g> </svg> <span> Go </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/languages/java/reactive-streams-driver/current/read/retrieve-data/#find-one-document" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 30 41" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M10.0921 30.7949C10.0921 30.7949 8.57608 31.6793 11.166 31.9636C14.2929 32.311 15.9037 32.2794 19.3464 31.6161C19.3464 31.6161 20.2623 32.1846 21.5257 32.6901C13.7876 35.9748 4.02791 32.5005 10.0921 30.7949Z" fill="#0074BD"> </path> <path d="M9.14539 26.4678C9.14539 26.4678 7.43985 27.7312 10.0298 27.9838C13.3778 28.3312 15.9992 28.3628 20.579 27.4785C20.579 27.4785 21.2107 28.1101 22.1898 28.4576C12.8724 31.2054 2.44949 28.6787 9.14539 26.4678Z" fill="#0074BD"> </path> <path d="M17.1039 19.1398C18.9989 21.3191 16.5985 23.3089 16.5985 23.3089C16.5985 23.3089 21.431 20.8138 19.2201 17.6869C17.1355 14.7811 15.5563 13.3282 24.1788 8.33789C24.1473 8.33789 10.6607 11.6858 17.1039 19.1398Z" fill="#EA2D2E"> </path> <path d="M27.3377 33.9845C27.3377 33.9845 28.4431 34.9004 26.1059 35.6269C21.6525 36.985 7.53417 37.3957 3.61769 35.6901C2.19639 35.0899 4.84949 34.2372 5.67069 34.0477C6.52347 33.8582 7.02884 33.8898 7.02884 33.8898C5.44961 32.7843 -3.10981 36.0691 2.67016 36.9851C18.4308 39.5433 31.4121 35.8164 27.3377 33.9845Z" fill="#0074BD"> </path> <path d="M10.8194 21.983C10.8194 21.983 3.6497 23.6885 8.2926 24.3203C10.2509 24.5729 14.1357 24.5097 17.7995 24.2255C20.7685 23.9728 23.7375 23.4359 23.7375 23.4359C23.7375 23.4359 22.6951 23.8781 21.9372 24.415C14.6411 26.3416 0.585992 25.4257 4.62881 23.4675C8.00839 21.7935 10.8194 21.983 10.8194 21.983Z" fill="#0074BD"> </path> <path d="M23.6745 29.1846C31.0969 25.3313 27.6542 21.6359 25.2538 22.1413C24.6537 22.2676 24.401 22.3623 24.401 22.3623C24.401 22.3623 24.6221 22.0149 25.0327 21.8886C29.7703 20.2146 33.4025 26.7842 23.5166 29.4057C23.5482 29.3741 23.6429 29.2794 23.6745 29.1846Z" fill="#0074BD"> </path> <path d="M19.2206 0.25293C19.2206 0.25293 23.3266 4.35891 15.3357 10.6758C8.92404 15.7293 13.8828 18.6351 15.3357 21.9199C11.6087 18.5403 8.86088 15.5714 10.6928 12.792C13.3775 8.74919 20.863 6.79093 19.2206 0.25293Z" fill="#EA2D2E"> </path> <path d="M11.5455 39.6068C18.6521 40.049 29.5803 39.3541 29.833 35.9746C29.833 35.9746 29.3276 37.238 23.9583 38.2487C17.894 39.3858 10.4085 39.2594 5.95508 38.533C5.95508 38.5646 6.87103 39.3225 11.5455 39.6068Z" fill="#0074BD"> </path> </svg> <span> Java RS </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/drivers/kotlin/coroutine/current/usage-examples/findOne/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M28 29H0V1H28L14 15L28 29Z" fill="url(#:R35tlqcmqn9:paint0_linear_211_40588)"> </path> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":R35tlqcmqn9:paint0_linear_211_40588" x1="28" x2="8.34465e-07" y1="0.999999" y2="29"> <stop offset="0.00343514" stop-color="#E44857"> </stop> <stop offset="0.4689" stop-color="#C711E1"> </stop> <stop offset="1" stop-color="#7F52FF"> </stop> </lineargradient> </defs> </svg> <span> Kotlin Coroutine </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-kotlin-sync/mongodb-driver-kotlin-sync/com.mongodb.kotlin.client/-find-iterable/index.html#-1236442442%2FFunctions%2F305748649" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M28 29H0V1H28L14 15L28 29Z" fill="url(#:R39tlqcmqn9:paint0_linear_211_40588)"> </path> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":R39tlqcmqn9:paint0_linear_211_40588" x1="28" x2="8.34465e-07" y1="0.999999" y2="29"> <stop offset="0.00343514" stop-color="#E44857"> </stop> <stop offset="0.4689" stop-color="#C711E1"> </stop> <stop offset="1" stop-color="#7F52FF"> </stop> </lineargradient> </defs> </svg> <span> Kotlin Sync </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/php-library/current/read/retrieve/#find-one-document" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 700 301" width="24" x="0" xmlns="http://www.w3.org/2000/svg" y="0"> <defs> <clippath clippathunits="userSpaceOnUse" id="a"> <path d="M11.52 162C11.52 81.677 135.307 16.561 288 16.561S564.481 81.677 564.481 162c0 80.322-123.788 145.439-276.481 145.439-152.693 0-276.48-65.117-276.48-145.439"> </path> </clippath> <clippath clippathunits="userSpaceOnUse" id="c"> <path d="M0 324h576V0H0v324z"> </path> </clippath> <clippath clippathunits="userSpaceOnUse" id="d"> <path d="M0 324h576V0H0v324z"> </path> </clippath> <radialgradient cx="0" cy="0" fx="0" fy="0" gradienttransform="matrix(363.05789 0 0 -363.05789 177.52 256.307)" gradientunits="userSpaceOnUse" id="b" r="1" spreadmethod="pad"> <stop offset="0" stop-color="#aeb2d5"> </stop> <stop offset=".3" stop-color="#aeb2d5"> </stop> <stop offset=".75" stop-color="#484c89"> </stop> <stop offset="1" stop-color="#484c89"> </stop> </radialgradient> </defs> <g clip-path="url(#a)" transform="matrix(1.25 0 0 -1.25 -4.4 394.299)"> <path d="M11.52 162C11.52 81.677 135.307 16.561 288 16.561S564.481 81.677 564.481 162c0 80.322-123.788 145.439-276.481 145.439-152.693 0-276.48-65.117-276.48-145.439" fill="url(#b)"> </path> </g> <g clip-path="url(#c)" transform="matrix(1.25 0 0 -1.25 -4.4 394.299)"> <path d="M288 27.36c146.729 0 265.68 60.28 265.68 134.64 0 74.36-118.951 134.641-265.68 134.641S22.32 236.36 22.32 162.001C22.32 87.64 141.271 27.358 288 27.358" fill="#777bb3"> </path> </g> <g clip-path="url(#d)" transform="matrix(1.25 0 0 -1.25 -4.4 394.299)"> <path d="M161.734 145.307c12.065 0 21.072 2.225 26.771 6.61 5.638 4.342 9.532 11.863 11.573 22.354 1.903 9.806 1.178 16.653-2.154 20.348-3.407 3.774-10.773 5.688-21.893 5.688h-19.28l-10.69-55h15.673zm-63.063-67.75a2.998 2.998 0 00-2.944 3.572l28.328 145.75a3 3 0 002.945 2.428h61.054c19.188 0 33.47-5.21 42.447-15.487 9.025-10.331 11.812-24.772 8.283-42.921-1.436-7.394-3.906-14.261-7.34-20.41-3.44-6.154-7.985-11.85-13.512-16.93-6.616-6.191-14.104-10.681-22.236-13.323-8.003-2.607-18.28-3.93-30.548-3.93h-24.722l-7.06-36.321a3 3 0 00-2.944-2.428h-31.75z"> </path> <path d="M159.224 197.307h16.808c13.42 0 18.083-2.945 19.667-4.7 2.628-2.914 3.124-9.058 1.435-17.767-1.898-9.75-5.416-16.663-10.458-20.545-5.162-3.974-13.554-5.988-24.941-5.988H149.7l9.523 49zm28.83 35H127a6 6 0 01-5.89-4.855L92.784 81.702a6 6 0 015.889-7.144h31.75a6 6 0 015.89 4.854l6.588 33.895h22.249c12.582 0 23.174 1.372 31.479 4.077 8.54 2.775 16.399 7.48 23.354 13.984 5.752 5.292 10.49 11.232 14.08 17.657 3.59 6.427 6.17 13.594 7.668 21.302 3.715 19.104.697 34.402-8.97 45.466-9.571 10.958-24.613 16.514-44.705 16.514m-45.633-90h19.313c12.8 0 22.336 2.411 28.6 7.234 6.267 4.824 10.493 12.875 12.689 24.157 2.1 10.832 1.144 18.476-2.871 22.93-4.02 4.452-12.06 6.68-24.121 6.68h-21.754l-11.856-61m45.633 84c18.367 0 31.766-4.82 40.188-14.462 8.42-9.64 10.957-23.098 7.597-40.375-1.383-7.117-3.722-13.624-7.015-19.519-3.297-5.899-7.602-11.293-12.922-16.184-6.34-5.933-13.383-10.16-21.133-12.679-7.75-2.525-17.621-3.782-29.621-3.782h-27.196l-7.531-38.75h-31.75L127 226.307h61.055" fill="#fff"> </path> <path d="M311.583 116.307c-.896 0-1.745.4-2.314 1.092a2.994 2.994 0 00-.631 2.48l12.531 64.489c1.192 6.133.898 10.535-.827 12.395-1.056 1.137-4.228 3.044-13.607 3.044h-22.702l-15.755-81.072a3 3 0 00-2.945-2.428h-31.5a2.998 2.998 0 00-2.945 3.572l28.328 145.75a3 3 0 002.945 2.428h31.5a3 3 0 002.945-3.572l-6.836-35.178h24.422c18.605 0 31.221-3.28 38.569-10.028 7.49-6.884 9.827-17.891 6.947-32.72l-13.18-67.824a3 3 0 00-2.945-2.428h-32z"> </path> <path d="M293.661 271.057h-31.5a6 6 0 01-5.89-4.855l-28.328-145.75a5.998 5.998 0 015.89-7.145h31.5a6 6 0 015.89 4.855l15.283 78.645h20.23c9.362 0 11.327-2 11.406-2.086.568-.61 1.315-3.44.082-9.78l-12.53-64.49a5.998 5.998 0 015.89-7.144h32a6 6 0 015.89 4.855l13.178 67.825c3.093 15.921.447 27.864-7.86 35.5-7.929 7.281-21.209 10.82-40.6 10.82h-20.784l6.143 31.605a6.001 6.001 0 01-5.89 7.145m0-6l-7.53-38.75h28.061c17.657 0 29.836-3.082 36.54-9.238 6.702-6.16 8.71-16.14 6.031-29.938l-13.18-67.824h-32l12.531 64.488c1.426 7.336.902 12.34-1.574 15.008-2.477 2.668-7.746 4.004-15.805 4.004H281.56l-16.226-83.5h-31.5l28.328 145.75h31.5" fill="#fff"> </path> <path d="M409.55 145.307c12.065 0 21.072 2.225 26.77 6.61 5.639 4.34 9.533 11.862 11.575 22.354 1.903 9.806 1.178 16.653-2.155 20.348-3.407 3.774-10.773 5.688-21.893 5.688h-19.281l-10.69-55h15.674zm-63.062-67.75a2.999 2.999 0 00-2.945 3.572l28.328 145.75a3.002 3.002 0 002.946 2.428h61.053c19.189 0 33.47-5.21 42.448-15.487 9.025-10.33 11.81-24.771 8.283-42.921-1.438-7.394-3.907-14.261-7.342-20.41-3.44-6.154-7.984-11.85-13.511-16.93-6.616-6.191-14.104-10.681-22.236-13.323-8.003-2.607-18.281-3.93-30.548-3.93H388.24l-7.057-36.321a3.001 3.001 0 00-2.946-2.428h-31.75z"> </path> <path d="M407.04 197.307h16.807c13.421 0 18.083-2.945 19.667-4.7 2.63-2.914 3.125-9.058 1.435-17.766-1.898-9.75-5.417-16.664-10.458-20.546-5.162-3.974-13.554-5.988-24.94-5.988h-12.034l9.522 49zm28.83 35h-61.054a6 6 0 01-5.889-4.855L340.6 81.702a6 6 0 015.889-7.144h31.75a6 6 0 015.89 4.854l6.587 33.895h22.25c12.581 0 23.173 1.372 31.478 4.077 8.541 2.775 16.401 7.481 23.356 13.986 5.752 5.291 10.488 11.23 14.078 17.655 3.591 6.427 6.171 13.594 7.668 21.302 3.715 19.105.697 34.403-8.969 45.467-9.572 10.957-24.613 16.513-44.706 16.513m-45.632-90h19.312c12.801 0 22.336 2.411 28.601 7.234 6.267 4.824 10.492 12.875 12.688 24.157 2.102 10.832 1.145 18.476-2.87 22.93-4.02 4.452-12.06 6.68-24.122 6.68h-21.754l-11.855-61m45.632 84c18.367 0 31.766-4.82 40.188-14.462 8.422-9.64 10.957-23.098 7.597-40.375-1.383-7.117-3.722-13.624-7.015-19.519-3.297-5.899-7.602-11.293-12.922-16.184-6.34-5.933-13.383-10.16-21.133-12.679-7.75-2.525-17.62-3.782-29.62-3.782h-27.197l-7.53-38.75h-31.75l28.328 145.75h61.054" fill="#fff"> </path> </g> </svg> <span> PHP </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/mongoid/current/reference/queries/" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" preserveaspectratio="xMidYMid" viewbox="0 0 300 240" width="24" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id=":R3htlqcmqn9:a" x1="84.75%" x2="58.254%" y1="111.399%" y2="64.584%"> <stop offset="0%" stop-color="#FB7655"> </stop> <stop offset="0%" stop-color="#FB7655"> </stop> <stop offset="41%" stop-color="#E42B1E"> </stop> <stop offset="99%" stop-color="#900"> </stop> <stop offset="100%" stop-color="#900"> </stop> </lineargradient> <lineargradient id=":R3htlqcmqn9:b" x1="116.651%" x2="1.746%" y1="60.89%" y2="19.288%"> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="99%" stop-color="#911209"> </stop> <stop offset="100%" stop-color="#911209"> </stop> </lineargradient> <lineargradient id=":R3htlqcmqn9:c" x1="75.774%" x2="38.978%" y1="219.327%" y2="7.829%"> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="99%" stop-color="#911209"> </stop> <stop offset="100%" stop-color="#911209"> </stop> </lineargradient> <lineargradient id=":R3htlqcmqn9:d" x1="50.012%" x2="66.483%" y1="7.234%" y2="79.135%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="23%" stop-color="#E57252"> </stop> <stop offset="46%" stop-color="#DE3B20"> </stop> <stop offset="99%" stop-color="#A60003"> </stop> <stop offset="100%" stop-color="#A60003"> </stop> </lineargradient> <lineargradient id=":R3htlqcmqn9:e" x1="46.174%" x2="49.932%" y1="16.348%" y2="83.047%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="23%" stop-color="#E4714E"> </stop> <stop offset="56%" stop-color="#BE1A0D"> </stop> <stop offset="99%" stop-color="#A80D00"> </stop> <stop offset="100%" stop-color="#A80D00"> </stop> </lineargradient> <lineargradient id=":R3htlqcmqn9:f" x1="36.965%" x2="49.528%" y1="15.594%" y2="92.478%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="18%" stop-color="#E46342"> </stop> <stop offset="40%" stop-color="#C82410"> </stop> <stop offset="99%" stop-color="#A80D00"> </stop> <stop offset="100%" stop-color="#A80D00"> </stop> </lineargradient> <lineargradient id=":R3htlqcmqn9:g" x1="13.609%" x2="85.764%" y1="58.346%" y2="-46.717%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="54%" stop-color="#C81F11"> </stop> <stop offset="99%" stop-color="#BF0905"> </stop> <stop offset="100%" stop-color="#BF0905"> </stop> </lineargradient> <lineargradient id=":R3htlqcmqn9:h" x1="27.624%" x2="50.745%" y1="21.135%" y2="79.056%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="31%" stop-color="#DE4024"> </stop> <stop offset="99%" stop-color="#BF190B"> </stop> <stop offset="100%" stop-color="#BF190B"> </stop> </lineargradient> <lineargradient id=":R3htlqcmqn9:i" x1="-20.667%" x2="104.242%" y1="122.282%" y2="-6.342%"> <stop offset="0%" stop-color="#BD0012"> </stop> <stop offset="0%" stop-color="#BD0012"> </stop> <stop offset="7%" stop-color="#FFF"> </stop> <stop offset="17%" stop-color="#FFF"> </stop> <stop offset="27%" stop-color="#C82F1C"> </stop> <stop offset="33%" stop-color="#820C01"> </stop> <stop offset="46%" stop-color="#A31601"> </stop> <stop offset="72%" stop-color="#B31301"> </stop> <stop offset="99%" stop-color="#E82609"> </stop> <stop offset="100%" stop-color="#E82609"> </stop> </lineargradient> <lineargradient id=":R3htlqcmqn9:j" x1="58.792%" x2="11.964%" y1="65.205%" y2="50.128%"> <stop offset="0%" stop-color="#8C0C01"> </stop> <stop offset="0%" stop-color="#8C0C01"> </stop> <stop offset="54%" stop-color="#990C00"> </stop> <stop offset="99%" stop-color="#A80D0E"> </stop> <stop offset="100%" stop-color="#A80D0E"> </stop> </lineargradient> <lineargradient id=":R3htlqcmqn9:k" x1="79.319%" x2="23.088%" y1="62.754%" y2="17.888%"> <stop offset="0%" stop-color="#7E110B"> </stop> <stop offset="0%" stop-color="#7E110B"> </stop> <stop offset="99%" stop-color="#9E0C00"> </stop> <stop offset="100%" stop-color="#9E0C00"> </stop> </lineargradient> <lineargradient id=":R3htlqcmqn9:l" x1="92.88%" x2="59.841%" y1="74.122%" y2="39.704%"> <stop offset="0%" stop-color="#79130D"> </stop> <stop offset="0%" stop-color="#79130D"> </stop> <stop offset="99%" stop-color="#9E120B"> </stop> <stop offset="100%" stop-color="#9E120B"> </stop> </lineargradient> <lineargradient id=":R3htlqcmqn9:o" x1="56.57%" x2="3.105%" y1="101.717%" y2="11.993%"> <stop offset="0%" stop-color="#8B2114"> </stop> <stop offset="0%" stop-color="#8B2114"> </stop> <stop offset="43%" stop-color="#9E100A"> </stop> <stop offset="99%" stop-color="#B3100C"> </stop> <stop offset="100%" stop-color="#B3100C"> </stop> </lineargradient> <lineargradient id=":R3htlqcmqn9:p" x1="30.87%" x2="92.471%" y1="35.599%" y2="100.694%"> <stop offset="0%" stop-color="#B31000"> </stop> <stop offset="0%" stop-color="#B31000"> </stop> <stop offset="44%" stop-color="#910F08"> </stop> <stop offset="99%" stop-color="#791C12"> </stop> <stop offset="100%" stop-color="#791C12"> </stop> </lineargradient> <radialgradient cx="32.001%" cy="40.21%" fx="32.001%" fy="40.21%" id=":R3htlqcmqn9:m" r="69.573%"> <stop offset="0%" stop-color="#A80D00"> </stop> <stop offset="0%" stop-color="#A80D00"> </stop> <stop offset="99%" stop-color="#7E0E08"> </stop> <stop offset="100%" stop-color="#7E0E08"> </stop> </radialgradient> <radialgradient cx="13.549%" cy="40.86%" fx="13.549%" fy="40.86%" id=":R3htlqcmqn9:n" r="88.386%"> <stop offset="0%" stop-color="#A30C00"> </stop> <stop offset="0%" stop-color="#A30C00"> </stop> <stop offset="99%" stop-color="#800E08"> </stop> <stop offset="100%" stop-color="#800E08"> </stop> </radialgradient> </defs> <path d="M197.467 167.764l-145.52 86.41 188.422-12.787L254.88 51.393l-57.414 116.37z" fill="url(#:R3htlqcmqn9:a)"> </path> <path d="M240.677 241.257L224.482 129.48l-44.113 58.25 60.308 53.528z" fill="url(#:R3htlqcmqn9:b)"> </path> <path d="M240.896 241.257l-118.646-9.313-69.674 21.986 188.32-12.673z" fill="url(#:R3htlqcmqn9:c)"> </path> <path d="M52.744 253.955l29.64-97.1L17.16 170.8l35.583 83.154z" fill="url(#:R3htlqcmqn9:d)"> </path> <path d="M180.358 188.05L153.085 81.226l-78.047 73.16 105.32 33.666z" fill="url(#:R3htlqcmqn9:e)"> </path> <path d="M248.693 82.73l-73.777-60.256-20.544 66.418 94.321-6.162z" fill="url(#:R3htlqcmqn9:f)"> </path> <path d="M214.191.99L170.8 24.97 143.424.669l70.767.322z" fill="url(#:R3htlqcmqn9:g)"> </path> <path d="M0 203.372l18.177-33.151-14.704-39.494L0 203.372z" fill="url(#:R3htlqcmqn9:h)"> </path> <path d="M2.496 129.48l14.794 41.963 64.283-14.422 73.39-68.207 20.712-65.787L143.063 0 87.618 20.75c-17.469 16.248-51.366 48.396-52.588 49-1.21.618-22.384 40.639-32.534 59.73z" fill="#FFF"> </path> <path d="M54.442 54.094c37.86-37.538 86.667-59.716 105.397-40.818 18.72 18.898-1.132 64.823-38.992 102.349-37.86 37.525-86.062 60.925-104.78 42.027-18.73-18.885.515-66.032 38.375-103.558z" fill="url(#:R3htlqcmqn9:i)"> </path> <path d="M52.744 253.916l29.408-97.409 97.665 31.376c-35.312 33.113-74.587 61.106-127.073 66.033z" fill="url(#:R3htlqcmqn9:j)"> </path> <path d="M155.092 88.622l25.073 99.313c29.498-31.016 55.972-64.36 68.938-105.603l-94.01 6.29z" fill="url(#:R3htlqcmqn9:k)"> </path> <path d="M248.847 82.833c10.035-30.282 12.35-73.725-34.966-81.791l-38.825 21.445 73.791 60.346z" fill="url(#:R3htlqcmqn9:l)"> </path> <path d="M0 202.935c1.39 49.979 37.448 50.724 52.808 51.162l-35.48-82.86L0 202.935z" fill="#9E1209"> </path> <path d="M155.232 88.777c22.667 13.932 68.35 41.912 69.276 42.426 1.44.81 19.695-30.784 23.838-48.64l-93.114 6.214z" fill="url(#:R3htlqcmqn9:m)"> </path> <path d="M82.113 156.507l39.313 75.848c23.246-12.607 41.45-27.967 58.121-44.42l-97.434-31.428z" fill="url(#:R3htlqcmqn9:n)"> </path> <path d="M17.174 171.34l-5.57 66.328c10.51 14.357 24.97 15.605 40.136 14.486-10.973-27.311-32.894-81.92-34.566-80.814z" fill="url(#:R3htlqcmqn9:o)"> </path> <path d="M174.826 22.654l78.1 10.96c-4.169-17.662-16.969-29.06-38.787-32.623l-39.313 21.663z" fill="url(#:R3htlqcmqn9:p)"> </path> </svg> <span> Mongoid </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/drivers/rust/current/fundamentals/crud/read-operations/retrieve/#find-one-document" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 30 30" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_5454_14623)"> <path d="M15.2561 3.08398C8.56014 3.08398 3.11035 8.53634 3.11035 15.2297C3.11035 21.9231 8.56271 27.3755 15.2561 27.3755C21.9495 27.3755 27.4019 21.9231 27.4019 15.2297C27.4019 8.53634 21.9495 3.08398 15.2561 3.08398ZM15.2381 4.16315C15.4458 4.16853 15.6432 4.25509 15.7881 4.40437C15.9331 4.55365 16.0142 4.75384 16.0141 4.96225C16.0141 5.17418 15.9299 5.37744 15.7801 5.5273C15.6302 5.67715 15.4269 5.76134 15.215 5.76134C15.0031 5.76134 14.7998 5.67715 14.65 5.5273C14.5001 5.37744 14.4159 5.17418 14.4159 4.96225C14.4159 4.85533 14.4373 4.7495 14.4789 4.65101C14.5205 4.55252 14.5814 4.46338 14.6581 4.38887C14.7347 4.31435 14.8256 4.25598 14.9252 4.21721C15.0249 4.17844 15.1313 4.16006 15.2381 4.16315ZM17.0676 5.47871C18.4704 5.74146 19.7992 6.30644 20.9617 7.13439C22.1242 7.96235 23.0926 9.03345 23.7995 10.2733L22.8565 12.4008C22.6947 12.7682 22.8617 13.1999 23.2265 13.3643L25.0406 14.1686C25.0968 14.7356 25.1037 15.3065 25.0611 15.8747H24.0513C23.9511 15.8747 23.91 15.9415 23.91 16.0391V16.5016C23.91 17.5911 23.2959 17.83 22.7563 17.8891C22.2424 17.9482 21.6746 17.6733 21.6026 17.3598C21.2994 15.6563 20.7958 15.294 19.9993 14.6645C20.9885 14.0375 22.0163 13.11 22.0163 11.8715C22.0163 10.5328 21.099 9.69002 20.4747 9.27634C19.5959 8.69822 18.6247 8.5826 18.3626 8.5826H7.93063C9.37312 6.97114 11.3066 5.88021 13.4318 5.47871L14.6626 6.76857C14.9401 7.05891 15.4 7.07176 15.6903 6.79169L17.0676 5.47871ZM5.71063 11.3936C5.91853 11.3996 6.11589 11.4864 6.26079 11.6356C6.40568 11.7849 6.48669 11.9847 6.4866 12.1927C6.4866 12.4046 6.40241 12.6079 6.25255 12.7577C6.10269 12.9076 5.89944 12.9918 5.6875 12.9918C5.47557 12.9918 5.27232 12.9076 5.12246 12.7577C4.9726 12.6079 4.88841 12.4046 4.88841 12.1927C4.88836 12.0858 4.90977 11.9799 4.95137 11.8814C4.99297 11.7829 5.0539 11.6938 5.13057 11.6193C5.20724 11.5448 5.29809 11.4864 5.39772 11.4476C5.49736 11.4089 5.60376 11.3905 5.71063 11.3936ZM24.7631 11.4295C24.971 11.4356 25.1683 11.5224 25.3132 11.6716C25.4581 11.8208 25.5391 12.0206 25.539 12.2286C25.539 12.4406 25.4548 12.6438 25.305 12.7937C25.1551 12.9435 24.9519 13.0277 24.7399 13.0277C24.528 13.0277 24.3247 12.9435 24.1749 12.7937C24.025 12.6438 23.9408 12.4406 23.9408 12.2286C23.9408 12.1217 23.9622 12.0159 24.0038 11.9174C24.0454 11.8189 24.1063 11.7298 24.183 11.6553C24.2597 11.5807 24.3505 11.5224 24.4502 11.4836C24.5498 11.4448 24.6562 11.4264 24.7631 11.4295ZM7.21632 11.558H8.60896V17.8377H5.79799C5.45083 16.6186 5.34264 15.3439 5.47938 14.0838L7.20091 13.3181C7.56834 13.1536 7.73535 12.7245 7.57091 12.3571L7.21632 11.558ZM13.0284 11.6248H16.3456C16.5177 11.6248 17.5558 11.8227 17.5558 12.6012C17.5558 13.2461 16.7592 13.4774 16.104 13.4774H13.0258L13.0284 11.6248ZM13.0284 16.1368H15.5696C15.8008 16.1368 16.8106 16.2036 17.1318 17.4934C17.232 17.8891 17.4556 19.179 17.6072 19.5927C17.7588 20.0552 18.3729 20.9802 19.0281 20.9802H23.1751C22.8972 21.3524 22.5933 21.7044 22.2656 22.0336L20.5774 21.6713C20.1843 21.5866 19.7963 21.8384 19.7115 22.2315L19.3107 24.102C18.0217 24.6859 16.622 24.9848 15.2069 24.9781C13.7919 24.9714 12.395 24.6595 11.1116 24.0635L10.7108 22.1929C10.626 21.7998 10.2406 21.548 9.84743 21.6328L8.19528 21.9874C7.88869 21.6711 7.6037 21.3346 7.34223 20.9802H15.3769C15.4668 20.9802 15.5285 20.9647 15.5285 20.88V18.0381C15.5285 17.9559 15.4668 17.9379 15.3769 17.9379H13.0258L13.0284 16.1368ZM9.3207 22.6452C9.5286 22.6512 9.72596 22.738 9.87085 22.8872C10.0157 23.0364 10.0968 23.2363 10.0967 23.4443C10.0967 23.6562 10.0125 23.8594 9.86262 24.0093C9.71276 24.1592 9.50951 24.2434 9.29757 24.2434C9.08564 24.2434 8.88239 24.1592 8.73253 24.0093C8.58267 23.8594 8.49848 23.6562 8.49848 23.4443C8.49843 23.3373 8.51984 23.2315 8.56144 23.133C8.60303 23.0345 8.66397 22.9454 8.74064 22.8709C8.81731 22.7964 8.90815 22.738 9.00779 22.6992C9.10743 22.6605 9.21383 22.6421 9.3207 22.6452ZM21.153 22.6811C21.3609 22.6872 21.5583 22.774 21.7031 22.9232C21.848 23.0724 21.929 23.2722 21.929 23.4802C21.929 23.6922 21.8448 23.8954 21.6949 24.0453C21.5451 24.1951 21.3418 24.2793 21.1299 24.2793C20.9179 24.2793 20.7147 24.1951 20.5648 24.0453C20.415 23.8954 20.3308 23.6922 20.3308 23.4802C20.3307 23.3733 20.3521 23.2675 20.3937 23.169C20.4353 23.0705 20.4963 22.9814 20.5729 22.9068C20.6496 22.8323 20.7404 22.774 20.8401 22.7352C20.9397 22.6964 21.0461 22.678 21.153 22.6811Z" fill="black"> </path> <path clip-rule="evenodd" d="M26.7232 15.2304C26.7232 18.2717 25.515 21.1885 23.3645 23.3391C21.2139 25.4896 18.2971 26.6978 15.2558 26.6978C12.2144 26.6978 9.29761 25.4896 7.14705 23.3391C4.99649 21.1885 3.78832 18.2717 3.78832 15.2304C3.78832 12.189 4.99649 9.27222 7.14705 7.12166C9.29761 4.9711 12.2144 3.76293 15.2558 3.76293C18.2971 3.76293 21.2139 4.9711 23.3645 7.12166C25.515 9.27222 26.7232 12.189 26.7232 15.2304ZM26.5073 14.1229L28.2957 15.2304L26.5073 16.3378L28.0439 17.7741L26.0757 18.5115L27.3039 20.2202L25.2252 20.5594L26.0988 22.4762L23.9944 22.4017L24.4775 24.4521L22.4271 23.969L22.5016 26.0734L20.5848 25.1998L20.2456 27.2785L18.5369 26.0503L17.7995 28.0185L16.3632 26.482L15.2558 28.2703L14.1483 26.482L12.712 28.0185L11.9746 26.0503L10.2659 27.2785L9.92672 25.1998L8.00992 26.0734L8.08443 23.969L6.03401 24.4521L6.51707 22.4017L4.4127 22.4762L5.28631 20.5594L3.20763 20.2202L4.43582 18.5115L2.46763 17.7741L4.00415 16.3378L2.21582 15.2304L4.00415 14.1229L2.46763 12.6866L4.43582 11.9492L3.20763 10.2405L5.28631 9.90133L4.4127 7.98453L6.51707 8.05904L6.03401 6.00862L8.08443 6.49168L8.00992 4.3873L9.92672 5.26092L10.2659 3.18223L11.9746 4.41043L12.712 2.44224L14.1483 3.97876L15.2558 2.19043L16.3632 3.97876L17.7995 2.44224L18.5369 4.41043L20.2456 3.18223L20.5848 5.26092L22.5016 4.3873L22.4271 6.49168L24.4775 6.00862L23.9944 8.05904L26.0988 7.98453L25.2252 9.90133L27.3039 10.2405L26.0757 11.9492L28.0439 12.6866L26.5073 14.1229Z" fill="black" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"> </path> </g> <defs> <clippath id="clip0_5454_14623"> <rect fill="black" height="30" width="30"> </rect> </clippath> </defs> </svg> <span> Rust </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/languages/scala/scala-driver/current/get-started/quickstart/#query-the-collection" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 70 70" width="24" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id=":R3ptlqcmqn9:aaa" x1=".006%" x2="96.837%" y1="49.998%" y2="49.998%"> <stop offset="0%" stop-color="#CD413F"> </stop> <stop offset="75.091%" stop-color="#CD4543"> </stop> <stop offset="100%" stop-color="#D04543"> </stop> </lineargradient> </defs> <g fill="none" fill-rule="nonzero"> <path d="M13 39v5c0 .843 17.73 2.255 29.28 5 5.582-1.327 9.72-2.966 9.72-5v-5c0-2.034-4.138-3.673-9.72-5C30.73 36.745 13 38.157 13 39M13 20v5c0 .843 17.73 2.255 29.28 5 5.582-1.327 9.72-2.966 9.72-5v-5c0-2.034-4.138-3.673-9.72-5C30.73 17.745 13 19.157 13 20" fill="#731818"> </path> <g fill="url(#:R3ptlqcmqn9:aaa)" transform="translate(13)"> <path d="M0 29.53v14.766c0-1.232 39-3.692 39-9.844V19.686c0 6.152-39 8.612-39 9.844M0 9.843V24.61c0-1.231 39-3.691 39-9.843V0C39 6.152 0 8.612 0 9.843M0 49.216v14.766c0-1.231 39-3.691 39-9.843V39.373c0 6.151-39 8.612-39 9.843"> </path> </g> </g> </svg> <span> Scala </span> </a> </div> <button class="leafygreen-ui-ki2t97"> Show all <svg aria-label="Chevron Down Icon" class="" fill="none" height="16" role="img" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M1.636 5.364a1 1 0 0 0 0 1.414l4.95 4.95.707.707a1 1 0 0 0 1.414 0l.707-.707 4.95-4.95a1 1 0 0 0 0-1.414l-.707-.707a1 1 0 0 0-1.414 0L8 8.899 3.757 4.657a1 1 0 0 0-1.414 0l-.707.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </button> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.collection.findOne(query, projection, options) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.collection.findOne" 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-method-db.collection.findOne"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns one document that satisfies the specified query criteria on the collection or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/#std-label-views-landing-page"> view <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The returned document may vary depending on the number of documents that match the query criteria, and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-plans/#std-label-query-plans-query-optimization"> query plan </a> used: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:25%"/> <col style="width:25%"/> <col style="width:50%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Number of matching documents </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Query plan </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Result </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 0 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Any </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The method returns <code class="leafygreen-ui-1l06pbn"> null </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 1 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Any </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The method returns the document that satisfies the specified query criteria. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 2 or more </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Collection Scan </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The method returns the first document according to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-natural-order"> natural order </a> . In <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-capped-collection"> capped collections </a> , natural order is the same as insertion order. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 2 or more </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Index Scan </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The method returns the first document retrieved from the index. </div> </div> </td> </tr> </tbody> </table> </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"> If the query plan changes to use a different index, the method may return a different document. If your use case requires that a particular record is chosen consistently, you must use the <code class="leafygreen-ui-1l06pbn"> options </code> document to specify a sort. For details on using <code class="leafygreen-ui-1l06pbn"> findOne() </code> with an <code class="leafygreen-ui-1l06pbn"> options </code> document, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-findOne-with-options" target="_self"> <span> example <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> If you specify a <code class="leafygreen-ui-1l06pbn"> projection </code> parameter, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.findOne" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> findOne() </code> </span> </a> returns a document that only contains the <code class="leafygreen-ui-1l06pbn"> projection </code> fields. The <code class="leafygreen-ui-1l06pbn"> _id </code> field is always included unless you explicitly exclude it. </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"> Although similar to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find() </code> </a> method, the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.findOne" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> findOne() </code> </span> </a> method returns a document rather than a cursor. </p> </div> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can use <code class="leafygreen-ui-1l06pbn"> db.collection.findOne() </code> for deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.findOne" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> findOne() </code> </span> </a> method has the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.collection.findOne( &lt;query&gt;, &lt;projection&gt;, &lt;options&gt; )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">collection</span>.<span class="lg-highlight-title lg-highlight-function">findOne</span>( &lt;<!-- -->query<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->projection<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->options<!-- -->&gt; <!-- -->)</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 <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.findOne" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> findOne() </code> </span> </a> method takes the following parameters: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> query </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. Specifies query selection criteria using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-projection-operators-top"> query operators <!-- --> . </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> projection </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. Specifies the fields to return using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-projection-operators-top"> projection operators </a> . Omit this parameter to return all fields in the matching document. For details, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-findOne-projection" target="_self"> <span> Projection <!-- --> . </span> </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> options </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Specifies additional options for the query. These options modify query behavior and how results are returned. To see available options, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/node-mongodb-native/4.0//interfaces/findoptions.html" rel="noopener noreferrer"> <span> FindOptions <!-- --> . </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Client Disconnection <a class="headerlink leafygreen-ui-1kepx47" href="#client-disconnection" 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="client-disconnection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 4.2, if the client that issued <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.findOne" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.findOne() </code> </span> </a> disconnects before the operation completes, MongoDB marks <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.findOne" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.findOne() </code> </span> </a> for termination using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/killOp/#mongodb-dbcommand-dbcmd.killOp"> <code class="leafygreen-ui-1l06pbn"> killOp </code> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-findOne-projection"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Projection <a class="headerlink leafygreen-ui-1kepx47" href="#projection" 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="projection"> </div> </a> </h3> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Language Consistency </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> As part of making <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find() </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findAndModify/#mongodb-method-db.collection.findAndModify"> <code class="leafygreen-ui-1l06pbn"> findAndModify() </code> </a> projection consistent with aggregation's <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/project/#mongodb-pipeline-pipe.-project"> <code class="leafygreen-ui-1l06pbn"> $project </code> </a> stage: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find() </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findAndModify/#mongodb-method-db.collection.findAndModify"> <code class="leafygreen-ui-1l06pbn"> findAndModify() </code> </a> projection can accept <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> aggregation expressions and syntax <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MongoDB enforces additional restrictions with regards to projections. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/limits/#mongodb-limit-Projection-Restrictions"> Projection Restrictions </a> for details. </p> </li> </ul> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> projection </code> parameter determines which fields are returned in the matching documents. The <code class="leafygreen-ui-1l06pbn"> projection </code> parameter takes a document of the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ field1: &lt;value&gt;, field2: &lt;value&gt; ... }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">field1</span>: &lt;<!-- -->value<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-attr">field2</span>: &lt;<!-- -->value<!-- -->&gt; <!-- -->...<!-- --> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:40%"/> <col style="width:60%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Projection </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> &lt;field&gt;: &lt;1 or true&gt; </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the inclusion of a field. If you specify a non-zero integer for the projection value, the operation treats the value as <code class="leafygreen-ui-1l06pbn"> true </code> . </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> &lt;field&gt;: &lt;0 or false&gt; </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the exclusion of a field. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> "&lt;field&gt;.$": &lt;1 or true&gt; </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/projection/positional/#mongodb-projection-proj.-"> <code class="leafygreen-ui-1l06pbn"> $ </code> </a> array projection operator to return the first element that matches the query condition on the array field. If you specify a non-zero integer for the projection value, the operation treats the value as <code class="leafygreen-ui-1l06pbn"> true </code> . </p> <p class="leafygreen-ui-1kp3ins"> Not available for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/#std-label-views-landing-page"> views <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> &lt;field&gt;: &lt;array projection&gt; </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Uses the array projection operators ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/projection/elemMatch/#mongodb-projection-proj.-elemMatch"> <code class="leafygreen-ui-1l06pbn"> $elemMatch </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/projection/slice/#mongodb-projection-proj.-slice"> <code class="leafygreen-ui-1l06pbn"> $slice </code> </a> ) to specify the array elements to include. </p> <p class="leafygreen-ui-1kp3ins"> Not available for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/#std-label-views-landing-page"> views <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> &lt;field&gt;: &lt;$meta expression&gt; </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/meta/#mongodb-expression-exp.-meta"> <code class="leafygreen-ui-1l06pbn"> $meta </code> </a> operator expression to specify the inclusion of available <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/meta/#mongodb-expression-exp.-meta"> <code class="leafygreen-ui-1l06pbn"> per-document metadata </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Not available for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/#std-label-views-landing-page"> views <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> &lt;field&gt;: &lt;aggregation expression&gt; </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Specifies the value of the projected field. </p> <p class="leafygreen-ui-1kp3ins"> With the use of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> aggregation expressions and syntax </a> , including the use of literals and aggregation variables, you can project new fields or project existing fields with new values. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you specify a non-numeric, non-boolean literal (such as a literal string or an array or an operator expression) for the projection value, the field is projected with the new value, for example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> { field: [ 1, 2, 3, "$someExistingField" ] } </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> { field: "New String Value" } </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> { field: { status: "Active", total: { $sum: "$existingArray" } } } </code> </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To project a literal value for a field, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/literal/#mongodb-expression-exp.-literal"> <code class="leafygreen-ui-1l06pbn"> $literal </code> </a> aggregation expression; for example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> { field: { $literal: 5 } } </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> { field: { $literal: true } } </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> { field: { $literal: { fieldWithValue0: 0, fieldWithValue1: 1 } } } </code> </p> </li> </ul> </li> </ul> </div> </div> </td> </tr> </tbody> </table> </div> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Embedded Field Specification <a class="headerlink leafygreen-ui-1kepx47" href="#embedded-field-specification" 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="embedded-field-specification"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> For fields in an embedded documents, you can specify the field using either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-dot-notation-embedded-fields"> dot notation </a> , for example <code class="leafygreen-ui-1l06pbn"> "field.nestedfield": &lt;value&gt; </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> nested form, for example <code class="leafygreen-ui-1l06pbn"> { field: { nestedfield: &lt;value&gt; } } </code> </p> </li> </ul> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> <code class="leafygreen-ui-1l06pbn"> _id </code> Field Projection <a class="headerlink leafygreen-ui-1kepx47" href="#_id-field-projection" 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="_id-field-projection"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> _id </code> field is included in the returned documents by default unless you explicitly specify <code class="leafygreen-ui-1l06pbn"> _id: 0 </code> in the projection to suppress the field. </p> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Inclusion or Exclusion <a class="headerlink leafygreen-ui-1kepx47" href="#inclusion-or-exclusion" 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="inclusion-or-exclusion"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> A <code class="leafygreen-ui-1l06pbn"> projection </code> <em> cannot </em> contain <em> both </em> include and exclude specifications, with the exception of the <code class="leafygreen-ui-1l06pbn"> _id </code> field: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In projections that <em> explicitly include </em> fields, the <code class="leafygreen-ui-1l06pbn"> _id </code> field is the only field that you can <em> explicitly exclude </em> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In projections that <em> explicitly excludes </em> fields, the <code class="leafygreen-ui-1l06pbn"> _id </code> field is the only field that you can <em> explicitly include </em> ; however, the <code class="leafygreen-ui-1l06pbn"> _id </code> field is included by default. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For more information on projection, see also: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#std-label-find-projection"> Projection </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/project-fields-from-query-results/#std-label-read-operations-projection"> Project Fields to Return from Query </a> </p> </li> </ul> </section> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> With Empty Query Specification <a class="headerlink leafygreen-ui-1kepx47" href="#with-empty-query-specification" 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="with-empty-query-specification"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following operation returns a single document from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bios-example-collection/#std-label-bios-example-collection"> bios collection <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.bios.findOne()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">bios</span>.<span class="lg-highlight-title lg-highlight-function">findOne</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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> With a Query Specification <a class="headerlink leafygreen-ui-1kepx47" href="#with-a-query-specification" 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="with-a-query-specification"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following operation returns the first matching document from the bios collection where either the field <code class="leafygreen-ui-1l06pbn"> first </code> in the embedded document <code class="leafygreen-ui-1l06pbn"> name </code> starts with the letter <code class="leafygreen-ui-1l06pbn"> G </code> <strong> or </strong> where the field <code class="leafygreen-ui-1l06pbn"> birth </code> is less than <code class="leafygreen-ui-1l06pbn"> new Date('01/01/1945') </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.bios.findOne(\n {\n $or: [\n { 'name.first' : /^G/ },\n { birth: { $lt: new Date('01/01/1945') } }\n ]\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">bios</span>.<span class="lg-highlight-title lg-highlight-function">findOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$or</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">'name.first'</span> <!-- -->: <span class="lg-highlight-regexp">/^G/</span> <!-- -->}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">birth</span>: <!-- -->{ <span class="lg-highlight-attr">$lt</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">'01/01/1945'</span>) } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> With a Projection <a class="headerlink leafygreen-ui-1kepx47" href="#with-a-projection" 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="with-a-projection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> projection </code> parameter specifies which fields to return. The parameter contains either include or exclude specifications, not both, unless the exclude is for the <code class="leafygreen-ui-1l06pbn"> _id </code> field. </p> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Specify the Fields to Return <a class="headerlink leafygreen-ui-1kepx47" href="#specify-the-fields-to-return" 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="specify-the-fields-to-return"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> The following operation finds a document in the bios collection and returns only the <code class="leafygreen-ui-1l06pbn"> name </code> , <code class="leafygreen-ui-1l06pbn"> contribs </code> and <code class="leafygreen-ui-1l06pbn"> _id </code> fields: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.bios.findOne(\n { },\n { name: 1, contribs: 1 }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">bios</span>.<span class="lg-highlight-title lg-highlight-function">findOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">contribs</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Return All but the Excluded Fields <a class="headerlink leafygreen-ui-1kepx47" href="#return-all-but-the-excluded-fields" 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="return-all-but-the-excluded-fields"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> The following operation returns a document in the bios collection where the <code class="leafygreen-ui-1l06pbn"> contribs </code> field contains the element <code class="leafygreen-ui-1l06pbn"> OOP </code> and returns all fields <em> except </em> the <code class="leafygreen-ui-1l06pbn"> _id </code> field, the <code class="leafygreen-ui-1l06pbn"> first </code> field in the <code class="leafygreen-ui-1l06pbn"> name </code> embedded document, and the <code class="leafygreen-ui-1l06pbn"> birth </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.bios.findOne(\n { contribs: 'OOP' },\n { _id: 0, 'name.first': 0, birth: 0 }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">bios</span>.<span class="lg-highlight-title lg-highlight-function">findOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">contribs</span>: <span class="lg-highlight-string">'OOP'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">'name.first'</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">birth</span>: <span class="lg-highlight-number">0</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-findOne-with-options"> </span> </section> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> With an Option <a class="headerlink leafygreen-ui-1kepx47" href="#with-an-option" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="with-an-option"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following operation uses the <code class="leafygreen-ui-1l06pbn"> sort </code> option to return the first matching document from the <em> sorted </em> <code class="leafygreen-ui-1l06pbn"> bios </code> collection. In this example, the collection is sorted by <code class="leafygreen-ui-1l06pbn"> birth </code> in ascending order. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.bios.findOne(\n { },\n { },\n { sort: { birth: 1 } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">bios</span>.<span class="lg-highlight-title lg-highlight-function">findOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">sort</span>: <!-- -->{ <span class="lg-highlight-attr">birth</span>: <span class="lg-highlight-number">1</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> The <code class="leafygreen-ui-1l06pbn"> findOne </code> Result Document <a class="headerlink leafygreen-ui-1kepx47" href="#the-findone-result-document" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="the-findone-result-document"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You cannot apply cursor methods to the result of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.findOne" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> findOne() </code> </span> </a> because a single document is returned. You have access to the document directly: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var myDocument = db.bios.findOne();\n\nif (myDocument) {\n var myName = myDocument.name;\n\n print (tojson(myName));\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> myDocument <!-- -->= <!-- -->db.<span class="lg-highlight-property">bios</span>.<span class="lg-highlight-title lg-highlight-function">findOne</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->myDocument) <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">var</span> myName <!-- -->= <!-- -->myDocument.<span class="lg-highlight-property">name</span>;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->print <!-- -->(<span class="lg-highlight-title lg-highlight-function">tojson</span>(<!-- -->myName))<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use Variables in <code class="leafygreen-ui-1l06pbn"> let </code> Option <a class="headerlink leafygreen-ui-1kepx47" href="#use-variables-in-let-option" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-variables-in-let-option"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can specify query options to modify query behavior and indicate how results are returned. </p> <p class="leafygreen-ui-1kp3ins"> For example, to define variables that you can access elsewhere in the <code class="leafygreen-ui-1l06pbn"> findOne </code> method, use the <code class="leafygreen-ui-1l06pbn"> let </code> option. To filter results using a variable, you must access the variable within the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/expr/#mongodb-query-op.-expr"> <code class="leafygreen-ui-1l06pbn"> $expr </code> </a> operator. </p> <p class="leafygreen-ui-1kp3ins"> Create a collection <code class="leafygreen-ui-1l06pbn"> cakeFlavors </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeFlavors.insertMany( [\n { _id: 1, flavor: \"chocolate\" },\n { _id: 2, flavor: \"strawberry\" },\n { _id: 3, flavor: \"cherry\" }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeFlavors</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">flavor</span>: <span class="lg-highlight-string">"chocolate"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">flavor</span>: <span class="lg-highlight-string">"strawberry"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">flavor</span>: <span class="lg-highlight-string">"cherry"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example defines a <code class="leafygreen-ui-1l06pbn"> targetFlavor </code> variable in <code class="leafygreen-ui-1l06pbn"> let </code> and uses the variable to retrieve the chocolate cake flavor: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeFlavors.findOne(\n { $expr: { $eq: [ \"$flavor\", \"$$targetFlavor\" ] } },\n { _id: 0 },\n { let : { targetFlavor: \"chocolate\" }\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeFlavors</span>.<span class="lg-highlight-title lg-highlight-function">findOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$expr</span>: <!-- -->{ <span class="lg-highlight-attr">$eq</span>: <!-- -->[ <span class="lg-highlight-string">"$flavor"</span>, <span class="lg-highlight-string">"$$targetFlavor"</span> ] } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-keyword">let</span> <!-- -->: <!-- -->{ <span class="lg-highlight-attr">targetFlavor</span>: <span class="lg-highlight-string">"chocolate"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ flavor: 'chocolate' }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">flavor</span>: <span class="lg-highlight-string">'chocolate'</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"> To see all available query options, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/node-mongodb-native/4.0//interfaces/findoptions.html" rel="noopener noreferrer"> <span> FindOptions <!-- --> . </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> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/sum/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $sum (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-sum--aggregation-" 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="-sum--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="group"> <dt> <code class="leafygreen-ui-1l06pbn"> $sum </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-group-grp.-sum" 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-group-grp.-sum"> </div> </a> </dt> <dd> </dd> </dl> <div> <p> <em> Changed <!-- --> in version <!-- --> 5.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Calculates and returns the collective sum of numeric values. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> ignores non-numeric values. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> is available in these stages: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/addFields/#mongodb-pipeline-pipe.-addFields"> <code class="leafygreen-ui-1l06pbn"> $addFields </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/bucket/#mongodb-pipeline-pipe.-bucket"> <code class="leafygreen-ui-1l06pbn"> $bucket </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/bucketAuto/#mongodb-pipeline-pipe.-bucketAuto"> <code class="leafygreen-ui-1l06pbn"> $bucketAuto </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/match/#mongodb-pipeline-pipe.-match"> <code class="leafygreen-ui-1l06pbn"> $match </code> </a> stage that includes an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/expr/#mongodb-query-op.-expr"> <code class="leafygreen-ui-1l06pbn"> $expr </code> </a> expression </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/project/#mongodb-pipeline-pipe.-project"> <code class="leafygreen-ui-1l06pbn"> $project </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/replaceRoot/#mongodb-pipeline-pipe.-replaceRoot"> <code class="leafygreen-ui-1l06pbn"> $replaceRoot </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/replaceWith/#mongodb-pipeline-pipe.-replaceWith"> <code class="leafygreen-ui-1l06pbn"> $replaceWith </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/set/#mongodb-pipeline-pipe.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> (Available starting in MongoDB 5.0) </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can use <code class="leafygreen-ui-1l06pbn"> $sum </code> for deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> When used as an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-agg-operators-group-accumulators"> accumulator </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> has this syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $sum: &lt;expression&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">{ $sum: &lt;expression&gt; }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> When not used as an accumulator, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> has this syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $sum: [ &lt;expression1&gt;, &lt;expression2&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">{ $sum: [ &lt;expression1&gt;, &lt;expression2&gt; ... ] }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on expressions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> Expression Operators <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Result Data Type <a class="headerlink leafygreen-ui-1kepx47" href="#result-data-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="result-data-type"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When input types are mixed, <code class="leafygreen-ui-1l06pbn"> $sum </code> promotes the smaller input type to the larger of the two. A type is considered larger when it represents a wider range of values. The order of numeric types from smallest to largest is: integer → long → double → decimal </p> <p class="leafygreen-ui-1kp3ins"> The larger of the input types also determines the result type unless the operation overflows and is beyond the range represented by that larger data type. In cases of overflow, <code class="leafygreen-ui-1l06pbn"> $sum </code> promotes the result according to the following order: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the larger input type is <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Int32"> <code class="leafygreen-ui-1l06pbn"> integer </code> </a> , the result type is promoted to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Int64"> <code class="leafygreen-ui-1l06pbn"> long </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the larger input type is <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Int64"> <code class="leafygreen-ui-1l06pbn"> long </code> </a> , the result type is promoted to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Double"> <code class="leafygreen-ui-1l06pbn"> double </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the larger type is <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Double"> <code class="leafygreen-ui-1l06pbn"> double </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Decimal128"> <code class="leafygreen-ui-1l06pbn"> decimal </code> </a> , the overflow result is represented as + or - infinity. There is no type promotion of the result. </p> </li> </ul> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Non-Numeric or Non-Existent Fields <a class="headerlink leafygreen-ui-1kepx47" href="#non-numeric-or-non-existent-fields" 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="non-numeric-or-non-existent-fields"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If used on a field that contains both numeric and non-numeric values, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> ignores the non-numeric values and returns the sum of the numeric values. </p> <p class="leafygreen-ui-1kp3ins"> If used on a field that does not exist in any document in the collection, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> returns <code class="leafygreen-ui-1l06pbn"> 0 </code> for that field. </p> <p class="leafygreen-ui-1kp3ins"> If all operands are non-numeric, non-arrays, or contain <code class="leafygreen-ui-1l06pbn"> null </code> values, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> returns <code class="leafygreen-ui-1l06pbn"> 0 </code> . For details on how <code class="leafygreen-ui-1l06pbn"> $sum </code> handles arrays, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-sum-array-operand" target="_self"> <span> Array Operand <!-- --> . </span> </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-sum-array-operand"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Array Operand <a class="headerlink leafygreen-ui-1kepx47" href="#array-operand" 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="array-operand"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> In the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> stage, if the expression resolves to an array, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> treats the operand as a non-numeric value. </p> <p class="leafygreen-ui-1kp3ins"> In the other supported stages: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> With a single expression as its operand, if the expression resolves to an array, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> traverses into the array to operate on the numeric elements of the array to return a single value. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> With a list of expressions as its operand, if any of the expressions resolves to an array, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> does <strong> not </strong> traverse into the array but instead treats the array as a non-numeric value. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For example, when not used in a <code class="leafygreen-ui-1l06pbn"> $group </code> stage: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the <code class="leafygreen-ui-1l06pbn"> $sum </code> operand is <code class="leafygreen-ui-1l06pbn"> [ 2, 2 ] </code> , <code class="leafygreen-ui-1l06pbn"> $sum </code> adds the array elements and returns 4. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the <code class="leafygreen-ui-1l06pbn"> $sum </code> operand is <code class="leafygreen-ui-1l06pbn"> [ 2, [ 3, 4 ] ] </code> , <code class="leafygreen-ui-1l06pbn"> $sum </code> returns 2 because it treats the nested array <code class="leafygreen-ui-1l06pbn"> [ 3, 4 ] </code> as a non-numeric value. </p> </li> </ul> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <span class="leafygreen-ui-1qnjd6d" id="std-label-sum-group-example"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use in <code class="leafygreen-ui-1l06pbn"> $group </code> Stage <a class="headerlink leafygreen-ui-1kepx47" href="#use-in--group-stage" 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-in--group-stage"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Consider a <code class="leafygreen-ui-1l06pbn"> sales </code> collection with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"item\" : \"abc\", \"price\" : 10, \"quantity\" : 2, \"date\" : ISODate(\"2014-01-01T08:00:00Z\") }\n{ \"_id\" : 2, \"item\" : \"jkl\", \"price\" : 20, \"quantity\" : 1, \"date\" : ISODate(\"2014-02-03T09:00:00Z\") }\n{ \"_id\" : 3, \"item\" : \"xyz\", \"price\" : 5, \"quantity\" : 5, \"date\" : ISODate(\"2014-02-03T09:05:00Z\") }\n{ \"_id\" : 4, \"item\" : \"abc\", \"price\" : 10, \"quantity\" : 10, \"date\" : ISODate(\"2014-02-15T08:00:00Z\") }\n{ \"_id\" : 5, \"item\" : \"xyz\", \"price\" : 5, \"quantity\" : 10, \"date\" : ISODate(\"2014-02-15T09:05:00Z\") }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-01-01T08:00:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"jkl"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">20</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-02-03T09:00:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-02-03T09:05:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-02-15T08:00:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-02-15T09:05:00Z"</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"> Grouping the documents by the day and the year of the <code class="leafygreen-ui-1l06pbn"> date </code> field, the following operation uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> accumulator to compute the total amount and the count for each group of documents. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.sales.aggregate(\n [\n {\n $group:\n {\n _id: { day: { $dayOfYear: \"$date\"}, year: { $year: \"$date\" } },\n totalAmount: { $sum: { $multiply: [ \"$price\", \"$quantity\" ] } },\n count: { $sum: 1 }\n }\n }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">sales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$group</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <!-- -->{ <span class="lg-highlight-attr">day</span>: <!-- -->{ <span class="lg-highlight-attr">$dayOfYear</span>: <span class="lg-highlight-string">"$date"</span>}<!-- -->, <span class="lg-highlight-attr">year</span>: <!-- -->{ <span class="lg-highlight-attr">$year</span>: <span class="lg-highlight-string">"$date"</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">totalAmount</span>: <!-- -->{ <span class="lg-highlight-attr">$sum</span>: <!-- -->{ <span class="lg-highlight-attr">$multiply</span>: <!-- -->[ <span class="lg-highlight-string">"$price"</span>, <span class="lg-highlight-string">"$quantity"</span> ] } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">count</span>: <!-- -->{ <span class="lg-highlight-attr">$sum</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : { \"day\" : 46, \"year\" : 2014 }, \"totalAmount\" : 150, \"count\" : 2 }\n{ \"_id\" : { \"day\" : 34, \"year\" : 2014 }, \"totalAmount\" : 45, \"count\" : 2 }\n{ \"_id\" : { \"day\" : 1, \"year\" : 2014 }, \"totalAmount\" : 20, \"count\" : 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"day"</span> <!-- -->: <span class="lg-highlight-number">46</span>, <span class="lg-highlight-string">"year"</span> <!-- -->: <span class="lg-highlight-number">2014</span> }<!-- -->, <span class="lg-highlight-string">"totalAmount"</span> <!-- -->: <span class="lg-highlight-number">150</span>, <span class="lg-highlight-string">"count"</span> <!-- -->: <span class="lg-highlight-number">2</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"day"</span> <!-- -->: <span class="lg-highlight-number">34</span>, <span class="lg-highlight-string">"year"</span> <!-- -->: <span class="lg-highlight-number">2014</span> }<!-- -->, <span class="lg-highlight-string">"totalAmount"</span> <!-- -->: <span class="lg-highlight-number">45</span>, <span class="lg-highlight-string">"count"</span> <!-- -->: <span class="lg-highlight-number">2</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"day"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"year"</span> <!-- -->: <span class="lg-highlight-number">2014</span> }<!-- -->, <span class="lg-highlight-string">"totalAmount"</span> <!-- -->: <span class="lg-highlight-number">20</span>, <span class="lg-highlight-string">"count"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> on a non-existent field returns a value of <code class="leafygreen-ui-1l06pbn"> 0 </code> . The following operation attempts to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> on <code class="leafygreen-ui-1l06pbn"> qty </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.sales.aggregate(\n [\n {\n $group:\n {\n _id: { day: { $dayOfYear: \"$date\"}, year: { $year: \"$date\" } },\n totalAmount: { $sum: \"$qty\" },\n count: { $sum: 1 }\n }\n }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">sales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$group</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <!-- -->{ <span class="lg-highlight-attr">day</span>: <!-- -->{ <span class="lg-highlight-attr">$dayOfYear</span>: <span class="lg-highlight-string">"$date"</span>}<!-- -->, <span class="lg-highlight-attr">year</span>: <!-- -->{ <span class="lg-highlight-attr">$year</span>: <span class="lg-highlight-string">"$date"</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">totalAmount</span>: <!-- -->{ <span class="lg-highlight-attr">$sum</span>: <span class="lg-highlight-string">"$qty"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">count</span>: <!-- -->{ <span class="lg-highlight-attr">$sum</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : { \"day\" : 46, \"year\" : 2014 }, \"totalAmount\" : 0, \"count\" : 2 }\n{ \"_id\" : { \"day\" : 34, \"year\" : 2014 }, \"totalAmount\" : 0, \"count\" : 2 }\n{ \"_id\" : { \"day\" : 1, \"year\" : 2014 }, \"totalAmount\" : 0, \"count\" : 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"day"</span> <!-- -->: <span class="lg-highlight-number">46</span>, <span class="lg-highlight-string">"year"</span> <!-- -->: <span class="lg-highlight-number">2014</span> }<!-- -->, <span class="lg-highlight-string">"totalAmount"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"count"</span> <!-- -->: <span class="lg-highlight-number">2</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"day"</span> <!-- -->: <span class="lg-highlight-number">34</span>, <span class="lg-highlight-string">"year"</span> <!-- -->: <span class="lg-highlight-number">2014</span> }<!-- -->, <span class="lg-highlight-string">"totalAmount"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"count"</span> <!-- -->: <span class="lg-highlight-number">2</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"day"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"year"</span> <!-- -->: <span class="lg-highlight-number">2014</span> }<!-- -->, <span class="lg-highlight-string">"totalAmount"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"count"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/count-accumulator/#mongodb-group-grp.-count"> <code class="leafygreen-ui-1l06pbn"> $count </code> </a> aggregation accumulator can be used in place of <code class="leafygreen-ui-1l06pbn"> { $sum : 1 } </code> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> stage. </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/reference/operator/aggregation/count-accumulator/#mongodb-group-grp.-count"> <code class="leafygreen-ui-1l06pbn"> $count (aggregation accumulator) </code> </a> </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-sum-project-example"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use in <code class="leafygreen-ui-1l06pbn"> $project </code> Stage <a class="headerlink leafygreen-ui-1kepx47" href="#use-in--project-stage" 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-in--project-stage"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> A collection <code class="leafygreen-ui-1l06pbn"> students </code> contains the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\": 1, \"quizzes\": [ 10, 6, 7 ], \"labs\": [ 5, 8 ], \"final\": 80, \"midterm\": 75 }\n{ \"_id\": 2, \"quizzes\": [ 9, 10 ], \"labs\": [ 8, 8 ], \"final\": 95, \"midterm\": 80 }\n{ \"_id\": 3, \"quizzes\": [ 4, 5, 5 ], \"labs\": [ 6, 5 ], \"final\": 78, \"midterm\": 70 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"quizzes"</span>: <!-- -->[ <span class="lg-highlight-number">10</span>, <span class="lg-highlight-number">6</span>, <span class="lg-highlight-number">7</span> ]<!-- -->, <span class="lg-highlight-string">"labs"</span>: <!-- -->[ <span class="lg-highlight-number">5</span>, <span class="lg-highlight-number">8</span> ]<!-- -->, <span class="lg-highlight-string">"final"</span>: <span class="lg-highlight-number">80</span>, <span class="lg-highlight-string">"midterm"</span>: <span class="lg-highlight-number">75</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"quizzes"</span>: <!-- -->[ <span class="lg-highlight-number">9</span>, <span class="lg-highlight-number">10</span> ]<!-- -->, <span class="lg-highlight-string">"labs"</span>: <!-- -->[ <span class="lg-highlight-number">8</span>, <span class="lg-highlight-number">8</span> ]<!-- -->, <span class="lg-highlight-string">"final"</span>: <span class="lg-highlight-number">95</span>, <span class="lg-highlight-string">"midterm"</span>: <span class="lg-highlight-number">80</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"quizzes"</span>: <!-- -->[ <span class="lg-highlight-number">4</span>, <span class="lg-highlight-number">5</span>, <span class="lg-highlight-number">5</span> ]<!-- -->, <span class="lg-highlight-string">"labs"</span>: <!-- -->[ <span class="lg-highlight-number">6</span>, <span class="lg-highlight-number">5</span> ]<!-- -->, <span class="lg-highlight-string">"final"</span>: <span class="lg-highlight-number">78</span>, <span class="lg-highlight-string">"midterm"</span>: <span class="lg-highlight-number">70</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/project/#mongodb-pipeline-pipe.-project"> <code class="leafygreen-ui-1l06pbn"> $project </code> </a> stage to calculate the total quiz scores, the total lab scores, and the total of the final and the midterm: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.aggregate([\n {\n $project: {\n quizTotal: { $sum: \"$quizzes\"},\n labTotal: { $sum: \"$labs\" },\n examTotal: { $sum: [ \"$final\", \"$midterm\" ] }\n }\n }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quizTotal</span>: <!-- -->{ <span class="lg-highlight-attr">$sum</span>: <span class="lg-highlight-string">"$quizzes"</span>}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">labTotal</span>: <!-- -->{ <span class="lg-highlight-attr">$sum</span>: <span class="lg-highlight-string">"$labs"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">examTotal</span>: <!-- -->{ <span class="lg-highlight-attr">$sum</span>: <!-- -->[ <span class="lg-highlight-string">"$final"</span>, <span class="lg-highlight-string">"$midterm"</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation results in the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"quizTotal\" : 23, \"labTotal\" : 13, \"examTotal\" : 155 }\n{ \"_id\" : 2, \"quizTotal\" : 19, \"labTotal\" : 16, \"examTotal\" : 175 }\n{ \"_id\" : 3, \"quizTotal\" : 14, \"labTotal\" : 11, \"examTotal\" : 148 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"quizTotal"</span> <!-- -->: <span class="lg-highlight-number">23</span>, <span class="lg-highlight-string">"labTotal"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"examTotal"</span> <!-- -->: <span class="lg-highlight-number">155</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"quizTotal"</span> <!-- -->: <span class="lg-highlight-number">19</span>, <span class="lg-highlight-string">"labTotal"</span> <!-- -->: <span class="lg-highlight-number">16</span>, <span class="lg-highlight-string">"examTotal"</span> <!-- -->: <span class="lg-highlight-number">175</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"quizTotal"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"labTotal"</span> <!-- -->: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-string">"examTotal"</span> <!-- -->: <span class="lg-highlight-number">148</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-sum-window-example"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use in <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> Stage <a class="headerlink leafygreen-ui-1kepx47" href="#use-in--setwindowfields-stage" 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-in--setwindowfields-stage"> </div> </a> </h3> <div> <p> <em> New <!-- --> in version <!-- --> 5.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Create a <code class="leafygreen-ui-1l06pbn"> cakeSales </code> collection that contains cake sales in the states of California ( <code class="leafygreen-ui-1l06pbn"> CA </code> ) and Washington ( <code class="leafygreen-ui-1l06pbn"> WA </code> ): </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.insertMany( [\n { _id: 0, type: \"chocolate\", orderDate: new Date(\"2020-05-18T14:10:30Z\"),\n state: \"CA\", price: 13, quantity: 120 },\n { _id: 1, type: \"chocolate\", orderDate: new Date(\"2021-03-20T11:30:05Z\"),\n state: \"WA\", price: 14, quantity: 140 },\n { _id: 2, type: \"vanilla\", orderDate: new Date(\"2021-01-11T06:31:15Z\"),\n state: \"CA\", price: 12, quantity: 145 },\n { _id: 3, type: \"vanilla\", orderDate: new Date(\"2020-02-08T13:13:23Z\"),\n state: \"WA\", price: 13, quantity: 104 },\n { _id: 4, type: \"strawberry\", orderDate: new Date(\"2019-05-18T16:09:01Z\"),\n state: \"CA\", price: 41, quantity: 162 },\n { _id: 5, type: \"strawberry\", orderDate: new Date(\"2019-01-08T06:12:03Z\"),\n state: \"WA\", price: 43, quantity: 134 }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">120</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">140</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">145</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">104</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">162</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">134</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This example uses <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage to output the sum of the <code class="leafygreen-ui-1l06pbn"> quantity </code> of cakes sold in each <code class="leafygreen-ui-1l06pbn"> state </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.aggregate( [\n {\n $setWindowFields: {\n partitionBy: \"$state\",\n sortBy: { orderDate: 1 },\n output: {\n sumQuantityForState: {\n $sum: \"$quantity\",\n window: {\n documents: [ \"unbounded\", \"current\" ]\n }\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <span class="lg-highlight-string">"$state"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sumQuantityForState</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$sum</span>: <span class="lg-highlight-string">"$quantity"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">window</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">documents</span>: <!-- -->[ <span class="lg-highlight-string">"unbounded"</span>, <span class="lg-highlight-string">"current"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> partitionBy: "$state" </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-partitionBy"> partitions </a> the documents in the collection by <code class="leafygreen-ui-1l06pbn"> state </code> . There are partitions for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sortBy: { orderDate: 1 } </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-sortBy"> sorts </a> the documents in each partition by <code class="leafygreen-ui-1l06pbn"> orderDate </code> in ascending order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ), so the earliest <code class="leafygreen-ui-1l06pbn"> orderDate </code> is first. </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> output </code> sets the <code class="leafygreen-ui-1l06pbn"> sumQuantityForState </code> field to the sum of the <code class="leafygreen-ui-1l06pbn"> quantity </code> values using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> that is run in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-documents"> documents </a> window. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-window"> window </a> contains documents between an <code class="leafygreen-ui-1l06pbn"> unbounded </code> lower limit and the <code class="leafygreen-ui-1l06pbn"> current </code> document in the output. This means <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-sum" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sum </code> </span> </a> returns the sum of the <code class="leafygreen-ui-1l06pbn"> quantity </code> values for the documents between the beginning of the partition and the current document. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> In this output, the sum of the <code class="leafygreen-ui-1l06pbn"> quantity </code> values for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> is shown in the <code class="leafygreen-ui-1l06pbn"> sumQuantityForState </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 4, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-05-18T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 41, \"quantity\" : 162, \"sumQuantityForState\" : 162 }\n{ \"_id\" : 0, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2020-05-18T14:10:30Z\"),\n \"state\" : \"CA\", \"price\" : 13, \"quantity\" : 120, \"sumQuantityForState\" : 282 }\n{ \"_id\" : 2, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2021-01-11T06:31:15Z\"),\n \"state\" : \"CA\", \"price\" : 12, \"quantity\" : 145, \"sumQuantityForState\" : 427 }\n{ \"_id\" : 5, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 43, \"quantity\" : 134, \"sumQuantityForState\" : 134 }\n{ \"_id\" : 3, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2020-02-08T13:13:23Z\"),\n \"state\" : \"WA\", \"price\" : 13, \"quantity\" : 104, \"sumQuantityForState\" : 238 }\n{ \"_id\" : 1, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2021-03-20T11:30:05Z\"),\n \"state\" : \"WA\", \"price\" : 14, \"quantity\" : 140, \"sumQuantityForState\" : 378 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>, <span class="lg-highlight-string">"sumQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">162</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">120</span>, <span class="lg-highlight-string">"sumQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">282</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">145</span>, <span class="lg-highlight-string">"sumQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">427</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"sumQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">134</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">104</span>, <span class="lg-highlight-string">"sumQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">238</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">140</span>, <span class="lg-highlight-string">"sumQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">378</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/query/maxDistance/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $maxDistance <a class="headerlink leafygreen-ui-1kepx47" href="#-maxdistance" 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="-maxdistance"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="query"> <dt> <code class="leafygreen-ui-1l06pbn"> $maxDistance </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-query-op.-maxDistance" 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-query-op.-maxDistance"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-maxDistance" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $maxDistance </code> </span> </a> operator constrains the results of a geospatial <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/near/#mongodb-query-op.-near"> <code class="leafygreen-ui-1l06pbn"> $near </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/nearSphere/#mongodb-query-op.-nearSphere"> <code class="leafygreen-ui-1l06pbn"> $nearSphere </code> </a> query to the specified distance. The measuring units for the maximum distance are determined by the coordinate system in use. For <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-GeoJSON"> GeoJSON </a> point objects, specify the distance in meters, not radians. You must specify a non-negative number for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-maxDistance" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $maxDistance </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index"> 2d </a> geospatial indexes both support <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-maxDistance" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $maxDistance </code> </span> </a> : . </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example query returns documents with location values that are <code class="leafygreen-ui-1l06pbn"> 10 </code> or fewer units from the point <code class="leafygreen-ui-1l06pbn"> [ -74 , 40 ] </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.places.find( {\n loc: { $near: [ -74 , 40 ], $maxDistance: 10 }\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">places</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">loc</span>: <!-- -->{ <span class="lg-highlight-attr">$near</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">74</span> <!-- -->, <span class="lg-highlight-number">40</span> ]<!-- -->, <span class="lg-highlight-attr">$maxDistance</span>: <span class="lg-highlight-number">10</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB orders the results by their distance from <code class="leafygreen-ui-1l06pbn"> [ -74 , 40 ] </code> . The operation returns the first 100 results, unless you modify the query with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.limit/#mongodb-method-cursor.limit"> <code class="leafygreen-ui-1l06pbn"> cursor.limit() </code> </a> method. </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDecimal/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $toDecimal (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-todecimal--aggregation-" 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="-todecimal--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $toDecimal </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-toDecimal" 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-expression-exp.-toDecimal"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Converts a value to a decimal. If the value cannot be converted to a decimal, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-toDecimal" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $toDecimal </code> </span> </a> errors. If the value is null or missing, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-toDecimal" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $toDecimal </code> </span> </a> returns null. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-toDecimal" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $toDecimal </code> </span> </a> has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n $toDecimal: &lt;expression&gt;\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$toDecimal</span>: &lt;<!-- -->expression<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-toDecimal" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $toDecimal </code> </span> </a> takes any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-toDecimal" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $toDecimal </code> </span> </a> is a shorthand for the following <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/convert/#mongodb-expression-exp.-convert"> <code class="leafygreen-ui-1l06pbn"> $convert </code> </a> expression: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $convert: { input: &lt;expression&gt;, to: \"decimal\" } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$convert</span>: <!-- -->{ <span class="lg-highlight-attr">input</span>: &lt;<!-- -->expression<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-attr">to</span>: <span class="lg-highlight-string">"decimal"</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-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/reference/operator/aggregation/convert/#mongodb-expression-exp.-convert"> <code class="leafygreen-ui-1l06pbn"> $convert </code> </a> </p> </div> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following table lists the input types that can be converted to a decimal: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Input Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Behavior </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> Returns <code class="leafygreen-ui-1l06pbn"> Decimal128("0") </code> for <code class="leafygreen-ui-1l06pbn"> false </code> . </div> <div class="line"> Returns <code class="leafygreen-ui-1l06pbn"> Decimal128("1") </code> for <code class="leafygreen-ui-1l06pbn"> true </code> . </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Double </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns double value as a decimal. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Decimal </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> No-op. Returns the decimal. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the int value as a decimal. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Long </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the long value as a decimal. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> String </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Returns the numerical value of the string as a decimal. </p> <p class="leafygreen-ui-1kp3ins"> The string value must be of a base <sub> 10 </sub> numeric value (e.g. <code class="leafygreen-ui-1l06pbn"> "-5.5" </code> , <code class="leafygreen-ui-1l06pbn"> "123456" </code> ). </p> <p class="leafygreen-ui-1kp3ins"> You cannot convert a string value of a non-base <sub> 10 </sub> number (e.g. <code class="leafygreen-ui-1l06pbn"> "0x6400" </code> ) </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Date </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the number of milliseconds since the epoch that corresponds to the date value. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> The following table lists some conversion to decimal examples: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:65%"/> <col style="width:35%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Results </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDecimal: true} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Decimal128("1") </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDecimal: false} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Decimal128("0") </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDecimal: 2.5} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Decimal128("2.50000000000000") </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDecimal: NumberInt(5)} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Decimal128("5") </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDecimal: NumberLong(10000)} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Decimal128("10000") </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDecimal: "-5.5"} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Decimal128("-5.5") </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDecimal: ISODate("2018-03-27T05:04:47.890Z")} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Decimal128("1522127087890") </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Create a collection <code class="leafygreen-ui-1l06pbn"> orders </code> with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.orders.insertMany( [\n { _id: 1, item: \"apple\", qty: 5, price: 10 },\n { _id: 2, item: \"pie\", qty: 10, price: NumberDecimal(\"20.0\") },\n { _id: 3, item: \"ice cream\", qty: 2, price: \"4.99\" },\n { _id: 4, item: \"almonds\", qty: 5, price: 5 }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">orders</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"apple"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">10</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"pie"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>(<span class="lg-highlight-string">"20.0"</span>) }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"ice cream"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-string">"4.99"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"almonds"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">5</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following aggregation operation on the <code class="leafygreen-ui-1l06pbn"> orders </code> collection converts the <code class="leafygreen-ui-1l06pbn"> price </code> to a decimal and the <code class="leafygreen-ui-1l06pbn"> qty </code> to an integer before calculating the total price: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"// Define stage to add convertedPrice and convertedQty fields with the converted price and qty values\n\npriceQtyConversionStage = {\n $addFields: {\n convertedPrice: { $toDecimal: \"$price\" },\n convertedQty: { $toInt: \"$qty\" },\n }\n};\n\n// Define stage to calculate total price by multiplying convertedPrice and convertedQty fields\n\n\ntotalPriceCalculationStage = {\n $project: { item: 1, totalPrice: { $multiply: [ \"$convertedPrice\", \"$convertedQty\" ] } }\n};\n\ndb.orders.aggregate( [\n priceQtyConversionStage,\n totalPriceCalculationStage\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">//</span><span class="lg-highlight-comment"> Define stage to </span><span class="lg-highlight-comment">add convertedPrice and convertedQty</span><span class="lg-highlight-comment"> fields with the </span><span class="lg-highlight-comment">converted</span><span class="lg-highlight-comment"> price and qty </span><span class="lg-highlight-comment">values</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">priceQtyConversionStage <!-- -->= <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$addFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">convertedPrice</span>: <!-- -->{ <span class="lg-highlight-attr">$toDecimal</span>: <span class="lg-highlight-string">"$price"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">convertedQty</span>: <!-- -->{ <span class="lg-highlight-attr">$toInt</span>: <span class="lg-highlight-string">"$qty"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">//</span><span class="lg-highlight-comment"> Define stage to </span><span class="lg-highlight-comment">calculate total price by multiplying convertedPrice and convertedQty fields</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">totalPriceCalculationStage <!-- -->= <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>: <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">totalPrice</span>: <!-- -->{ <span class="lg-highlight-attr">$multiply</span>: <!-- -->[ <span class="lg-highlight-string">"$convertedPrice"</span>, <span class="lg-highlight-string">"$convertedQty"</span> ] } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">orders</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->priceQtyConversionStage<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->totalPriceCalculationStage</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ _id: 1, item: 'apple', totalPrice: Decimal128(\"50\") },\n{ _id: 2, item: 'pie', totalPrice: Decimal128(\"200.0\") },\n{ _id: 3, item: 'ice cream', totalPrice: Decimal128(\"9.98\") },\n{ _id: 4, item: 'almonds', totalPrice: Decimal128(\"25\") }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'apple'</span>, <span class="lg-highlight-attr">totalPrice</span>: <span class="lg-highlight-title lg-highlight-class">Decimal128</span>(<span class="lg-highlight-string">"50"</span>) }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'pie'</span>, <span class="lg-highlight-attr">totalPrice</span>: <span class="lg-highlight-title lg-highlight-class">Decimal128</span>(<span class="lg-highlight-string">"200.0"</span>) }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'ice cream'</span>, <span class="lg-highlight-attr">totalPrice</span>: <span class="lg-highlight-title lg-highlight-class">Decimal128</span>(<span class="lg-highlight-string">"9.98"</span>) }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'almonds'</span>, <span class="lg-highlight-attr">totalPrice</span>: <span class="lg-highlight-title lg-highlight-class">Decimal128</span>(<span class="lg-highlight-string">"25"</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-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If the conversion operation encounters an error, the aggregation operation stops and throws an error. To override this behavior, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/convert/#mongodb-expression-exp.-convert"> <code class="leafygreen-ui-1l06pbn"> $convert </code> </a> instead. </p> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/upgrade-to-enterprise-sharded-cluster/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Upgrade to MongoDB Enterprise (Sharded Cluster) <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-to-mongodb-enterprise--sharded-cluster-" 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="upgrade-to-mongodb-enterprise--sharded-cluster-"> </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="#consideration" target="_self"> <span> Consideration </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#download-enterprise-binaries" target="_self"> <span> Download Enterprise Binaries </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#before-you-begin" target="_self"> <span> Before You Begin </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#procedure" target="_self"> <span> Procedure </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB Enterprise provides various features not available in the MongoDB Community edition, such as: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/inmemory/"> In-Memory Storage Engine for Self-Managed Deployments </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/auditing/"> Auditing Self-Managed Deployments </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/kerberos/"> Kerberos Authentication on Self-Managed Deployments </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-ldap/"> Self-Managed LDAP Proxy Authentication </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-ldap-external/"> LDAP Authorization on Self-Managed Deployments </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-encryption-at-rest/"> Encryption at Rest </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The following steps outline the procedure to upgrade a sharded cluster from the MongoDB Community Edition to the MongoDB Enterprise Edition. For example, the steps can be used to upgrade MongoDB 7.0 Community to MongoDB 7.0 Enterprise. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Consideration <a class="headerlink leafygreen-ui-1kepx47" href="#consideration" 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="consideration"> </div> </a> </h2> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Do not use these instructions to upgrade to another release version. To upgrade release versions, refer to the appropriate release upgrade instructions, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/8.0/#std-label-8.0-upgrade"> Upgrade to MongoDB 8.0 <!-- --> . </a> </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Download Enterprise Binaries <a class="headerlink leafygreen-ui-1kepx47" href="#download-enterprise-binaries" 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="download-enterprise-binaries"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Depending on your operating system, you can install the MongoDB Enterprise binaries by using a package manager or by downloading the binaries manually. </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-6"> <div aria-label="Tabs to describe usage of linux-manual/linux-package/macos/windows" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_j2resg4fo" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_gq412jggv" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Linux (Package Manager) </div> </button> <button aria-controls="_n0hlvkwo7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_sx0fe1rd3" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Linux (Manual Download) </div> </button> <button aria-controls="_biqgishjw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_4696d1glh" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Windows </div> </button> <button aria-controls="_ik7znbl77" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_f2w63xkxr" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> macOS </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_h5j9xbqyi" class="" id="_vgl59mg1n" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If you have installed MongoDB Community using a package manager, follow the package manager instructions for your operating system: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-enterprise-on-red-hat/#std-label-install-mdb-enterprise-redhat-centos"> Red Hat Enterprise or CentOS </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-enterprise-on-ubuntu/#std-label-install-mdb-enterprise-ubuntu"> Ubuntu </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-enterprise-on-debian/#std-label-install-mdb-enterprise-debian"> Debian </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-enterprise-on-suse/#std-label-install-mdb-enterprise-suse"> SUSE </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-enterprise-on-amazon/#std-label-install-mdb-enterprise-amazon"> Amazon Linux </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> During the installation, the package manager will remove the community packages; this will not affect the running deployment until you restart. </p> </div> </div> </div> <div> <div aria-labelledby="_cyxg1tzw2" class="leafygreen-ui-38lglc" id="_4k9i0x67s" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If you have not installed MongoDB using a package manager, you can manually download the MongoDB binaries from the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/try/download/enterprise?tck=docs_server" target="_self"> <span> MongoDB Download Center </span> </a> . Follow the manual instructions, including specific prerequisites for MongoDB Enterprise, for your operating system: </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"> Install to a location different from that of your current Community edition. </p> <p class="leafygreen-ui-1kp3ins"> In the upgrade procedure, you will use the existing data directory and, if applicable, the existing configuration file. </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-enterprise-on-red-hat-tarball/#std-label-install-mdb-enterprise-redhat-centos-tgz"> Red Hat Enterprise or CentOS </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-enterprise-on-ubuntu-tarball/#std-label-install-mdb-enterprise-ubuntu-tgz"> Ubuntu </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-enterprise-on-debian-tarball/#std-label-install-mdb-enterprise-debian-tgz"> Debian </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-enterprise-on-suse-tarball/#std-label-install-mdb-enterprise-suse-tgz"> SUSE </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-enterprise-on-amazon-tarball/#std-label-install-mdb-enterprise-amazon-tgz"> Amazon Linux </a> </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_ag24s7kaw" class="leafygreen-ui-38lglc" id="_z9un6jc5e" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You cannot use the <code class="leafygreen-ui-1l06pbn"> .msi </code> to install the Enterprise edition if you have the Community edition of the same release series installed on the same machine. That is, if you have version 4.4.0 Community edition installed, you cannot use the <code class="leafygreen-ui-1l06pbn"> .msi </code> to install the 4.4.0 or 4.4.1 Enterprise edition. </p> </div> </div> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Manually download the archive file from the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/try/download/enterprise?tck=docs_server" target="_self"> <span> MongoDB Download Center <!-- --> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To install, extract/unzip the file to a location different from that of your current Community edition. </p> <p class="leafygreen-ui-1kp3ins"> In the upgrade procedure, you will use the existing data directory and, if applicable, the existing configuration file. </p> </li> </ol> </div> </div> </div> <div> <div aria-labelledby="_e9z3s6bdx" class="leafygreen-ui-38lglc" id="_84ot0cg1s" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> Install the binaries: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Manually download the archive file from the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/try/download/enterprise?tck=docs_server" target="_self"> <span> MongoDB Download Center <!-- --> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Extract the files to a location different from that of your current Community edition. For details on extracting the files, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-enterprise-on-os-x/"> macOS <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> In the upgrade procedure, you will use the existing data directory and, if applicable, the existing configuration file. </p> </li> </ol> </div> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Before You Begin <a class="headerlink leafygreen-ui-1kepx47" href="#before-you-begin" 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="before-you-begin"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-directShardOperations"> <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> </a> role to perform maintenance operations that require you to execute commands directly against a shard. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Running commands using the <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> role can cause your cluster to stop working correctly and may cause data corruption. Only use the <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> role for maintenance purposes or under the guidance of MongoDB support. Once you are done performing maintenance operations, stop using the <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> role. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#procedure" 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="procedure"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To minimize downtime, you can upgrade from MongoDB Community to Enterprise Edition using a "rolling" upgrade by upgrading the members individually while the other members are available. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Disable the Balancer.Connect mongosh to a mongos instance in\nthe sharded cluster, and run sh.stopBalancer() to\ndisable the balancer:If a migration is in progress, the system will complete the\nin-progress migration before stopping the balancer. You can run\nsh.isBalancerRunning() to check the balancer's current\nstate.To verify that the balancer is disabled, run\nsh.getBalancerState(), which returns false if the balancer\nis disabled:Starting in MongoDB 6.0.3, automatic chunk splitting is not performed.\nThis is because of balancing policy improvements. Auto-splitting commands\nstill exist, but do not perform an operation.In MongoDB versions earlier than 6.0.3, sh.stopBalancer()\nalso disables auto-splitting for the sharded cluster.For more information on disabling the balancer, see\nDisable the Balancer."},{"@type":"HowToStep","text":"Upgrade the config servers.Upgrade the secondary\nmembers of the replica set one at a time:Shut down the secondary mongod instance.Restart the member with the Enterprise mongod,\nspecifying the same configuration options (e.g. same\ndata directory, configuration file, etc.).Wait for the member to recover to SECONDARY state before\nupgrading the next secondary member. To check the member's state,\nissue rs.status() in mongosh.Repeat for each remaining secondary member.Step down the replica set primary.Connect mongosh to the primary and use\nrs.stepDown() to step down the primary and force an\nelection of a new primary:When rs.status() shows that the primary has stepped\ndown and another member is primary, upgrade the stepped-down\nprimary:Shut down the stepped-down primary.Restart with the Enterprise mongod,\nspecifying the same configuration options (e.g. same\ndata directory, configuration file, etc.)."},{"@type":"HowToStep","text":"Upgrade the shards.Upgrade the shards one at a time.For each shard replica set:Upgrade the secondary\nmembers of the replica set one at a time:Shut down the secondary mongod instance.Restart the member with the Enterprise mongod,\nspecifying the same configuration options (e.g. same\ndata directory, configuration file, etc.).Wait for the member to recover to SECONDARY state before\nupgrading the next secondary member. To check the member's state,\nissue rs.status() in mongosh.Repeat for each remaining secondary member.Step down the replica set primary.Connect mongosh to the primary and use\nrs.stepDown() to step down the primary and force an\nelection of a new primary:When rs.status() shows that the primary has stepped\ndown and another member is primary, upgrade the stepped-down\nprimary:Shut down the stepped-down primary.Restart with the Enterprise mongod,\nspecifying the same configuration options (e.g. same\ndata directory, configuration file, etc.)."},{"@type":"HowToStep","text":"Upgrade the mongos instances.For each mongos instance, shutdown\nmongos and restart with the Enterprise mongos,\nspecifying the same configuration options."},{"@type":"HowToStep","text":"Re-enable the balancer.Using mongosh, connect to a\nmongos in the cluster and run\nsh.startBalancer() to re-enable the balancer:Starting in MongoDB 6.0.3, automatic chunk splitting is not performed.\nThis is because of balancing policy improvements. Auto-splitting commands\nstill exist, but do not perform an operation.In MongoDB versions earlier than 6.0.3, sh.startBalancer()\nalso enables auto-splitting for the sharded cluster.For more inforamtion on the balancer, see\nEnable the Balancer."}],"name":"Procedure","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Disable the Balancer. <a class="headerlink leafygreen-ui-1kepx47" href="#disable-the-balancer" 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="disable-the-balancer"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Connect <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> to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance in the sharded cluster, and run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.stopBalancer/#mongodb-method-sh.stopBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.stopBalancer() </code> </a> to disable the balancer: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.stopBalancer()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">stopBalancer</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-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If a migration is in progress, the system will complete the in-progress migration before stopping the balancer. You can run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.isBalancerRunning/#mongodb-method-sh.isBalancerRunning"> <code class="leafygreen-ui-1l06pbn"> sh.isBalancerRunning() </code> </a> to check the balancer's current state. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> To verify that the balancer is disabled, run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.getBalancerState/#mongodb-method-sh.getBalancerState"> <code class="leafygreen-ui-1l06pbn"> sh.getBalancerState() </code> </a> , which returns false if the balancer is disabled: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.getBalancerState()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">getBalancerState</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"> Starting in MongoDB 6.0.3, automatic chunk splitting is not performed. This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation. </p> <p class="leafygreen-ui-1kp3ins"> In MongoDB versions earlier than 6.0.3, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.stopBalancer/#mongodb-method-sh.stopBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.stopBalancer() </code> </a> also disables auto-splitting for the sharded cluster. </p> <p class="leafygreen-ui-1kp3ins"> For more information on disabling the balancer, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-sharded-cluster-balancer/#std-label-sharding-balancing-disable-temporarily"> Disable the Balancer <!-- --> . </a> </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Upgrade the config servers. <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-the-config-servers" 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="upgrade-the-config-servers"> </div> </a> </h3> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Upgrade the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-members/#std-label-replica-set-secondary-members"> secondary </a> members of the replica set one at a time: </p> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Shut down the secondary <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Restart the member with the Enterprise <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> , specifying the same configuration options (e.g. same data directory, configuration file, etc.). </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Wait for the member to recover to <code class="leafygreen-ui-1l06pbn"> SECONDARY </code> state before upgrading the next secondary member. To check the member's state, issue <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> 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> </li> </ol> <p class="leafygreen-ui-1kp3ins"> Repeat for each remaining secondary member. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Step down the replica set primary. </p> <p class="leafygreen-ui-1kp3ins"> Connect <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> to the primary and use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.stepDown/#mongodb-method-rs.stepDown"> <code class="leafygreen-ui-1l06pbn"> rs.stepDown() </code> </a> to step down the primary and force an election of a new primary: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"rs.stepDown()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">stepDown</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> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> shows that the primary has stepped down and another member is primary, upgrade the stepped-down primary: </p> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Shut down the stepped-down primary. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Restart with the Enterprise <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> , specifying the same configuration options (e.g. same data directory, configuration file, etc.). </p> </li> </ol> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Upgrade the shards. <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-the-shards" 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="upgrade-the-shards"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Upgrade the shards one at a time. </p> <p class="leafygreen-ui-1kp3ins"> For each shard replica set: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Upgrade the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-members/#std-label-replica-set-secondary-members"> secondary </a> members of the replica set one at a time: </p> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Shut down the secondary <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Restart the member with the Enterprise <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> , specifying the same configuration options (e.g. same data directory, configuration file, etc.). </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Wait for the member to recover to <code class="leafygreen-ui-1l06pbn"> SECONDARY </code> state before upgrading the next secondary member. To check the member's state, issue <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> 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> </li> </ol> <p class="leafygreen-ui-1kp3ins"> Repeat for each remaining secondary member. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Step down the replica set primary. </p> <p class="leafygreen-ui-1kp3ins"> Connect <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> to the primary and use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.stepDown/#mongodb-method-rs.stepDown"> <code class="leafygreen-ui-1l06pbn"> rs.stepDown() </code> </a> to step down the primary and force an election of a new primary: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"rs.stepDown()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">stepDown</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> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> shows that the primary has stepped down and another member is primary, upgrade the stepped-down primary: </p> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Shut down the stepped-down primary. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Restart with the Enterprise <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> , specifying the same configuration options (e.g. same data directory, configuration file, etc.). </p> </li> </ol> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Upgrade the <code class="leafygreen-ui-1l06pbn"> mongos </code> instances. <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-the-mongos-instances" 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="upgrade-the-mongos-instances"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> For each <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance, shutdown <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> and restart with the Enterprise <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , specifying the same configuration options. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Re-enable the balancer. <a class="headerlink leafygreen-ui-1kepx47" href="#re-enable-the-balancer" 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="re-enable-the-balancer"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , connect to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> in the cluster and run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.startBalancer/#mongodb-method-sh.startBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.startBalancer() </code> </a> to re-enable the balancer: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.startBalancer()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">startBalancer</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"> Starting in MongoDB 6.0.3, automatic chunk splitting is not performed. This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation. </p> <p class="leafygreen-ui-1kp3ins"> In MongoDB versions earlier than 6.0.3, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.startBalancer/#mongodb-method-sh.startBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.startBalancer() </code> </a> also enables auto-splitting for the sharded cluster. </p> <p class="leafygreen-ui-1kp3ins"> For more inforamtion on the balancer, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-sharded-cluster-balancer/#std-label-sharding-balancing-enable"> Enable the Balancer <!-- --> . </a> </p> </section> </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"> Before using any Enterprise features, ensure that all members have been upgraded to Enterprise edition. </p> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/sampleRate/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $sampleRate (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-samplerate--aggregation-" 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="-samplerate--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $sampleRate </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-sampleRate" 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-expression-exp.-sampleRate"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Matches a random selection of input documents. The number of documents selected approximates the sample rate expressed as a percentage of the total number of documents. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-sampleRate" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sampleRate </code> </span> </a> operator has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $sampleRate: &lt;non-negative&gt; }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$sampleRate</span>: <span class="lg-highlight-tag lg-highlight-xml">&lt;</span><span class="lg-highlight-name lg-highlight-tag lg-highlight-xml">non-negative</span><span class="lg-highlight-tag lg-highlight-xml"> </span><span class="lg-highlight-attr lg-highlight-tag lg-highlight-xml">float</span><span class="lg-highlight-tag lg-highlight-xml">&gt;</span><span class="lg-highlight-xml"> }</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> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The selection process uses a uniform random distribution. The sample rate is a floating point number between 0 and 1, inclusive, which represents the probability that a given document will be selected as it passes through the pipeline. </p> <p class="leafygreen-ui-1kp3ins"> For example, a sample rate of <code class="leafygreen-ui-1l06pbn"> 0.33 </code> selects roughly one document in three. </p> <p class="leafygreen-ui-1kp3ins"> This expression: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $match: { $sampleRate: 0.33 } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$match</span>: <!-- -->{ <span class="lg-highlight-attr">$sampleRate</span>: <span class="lg-highlight-number">0.33</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"> is equivalent to using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/rand/#mongodb-expression-exp.-rand"> <code class="leafygreen-ui-1l06pbn"> $rand </code> </a> operator as follows: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $match: { $expr: { $lt: [ { $rand: {} }, 0.33 ] } } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$match</span>: <!-- -->{ <span class="lg-highlight-attr">$expr</span>: <!-- -->{ <span class="lg-highlight-attr">$lt</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">$rand</span>: <!-- -->{<!-- -->} }<!-- -->, <span class="lg-highlight-number">0.33</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"> Repeated runs on the same data will produce different outcomes since the selection process is non-deterministic. In general, smaller datasets will show more variability in the number of documents selected on each run. As collection size increases, the number of documents chosen will approach the expected value for a uniform random distribution. </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"> If an exact number of documents is required from each run, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sample/#mongodb-pipeline-pipe.-sample"> <code class="leafygreen-ui-1l06pbn"> $sample </code> </a> operator should be used instead of <code class="leafygreen-ui-1l06pbn"> $sampleRate </code> . </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This code creates a small collection with 100 documents. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"N = 100\nbulk = db.collection.initializeUnorderedBulkOp()\nfor ( i = 0; i &lt; N; i++) { bulk.insert( {_id: i, r: 0} ) }\nbulk.execute()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">N <!-- -->= <span class="lg-highlight-number">100</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">bulk <!-- -->= <!-- -->db.<span class="lg-highlight-property">collection</span>.<span class="lg-highlight-title lg-highlight-function">initializeUnorderedBulkOp</span>(<!-- -->)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">for</span> <!-- -->( <!-- -->i <!-- -->= <span class="lg-highlight-number">0</span>; <!-- -->i <!-- -->&lt; <!-- -->N<!-- -->; <!-- -->i<!-- -->+<!-- -->+<!-- -->) <!-- -->{ <!-- -->bulk.<span class="lg-highlight-title lg-highlight-function">insert</span>( <!-- -->{<span class="lg-highlight-attr">_id</span>: <!-- -->i<!-- -->, <span class="lg-highlight-attr">r</span>: <span class="lg-highlight-number">0</span>} ) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bulk.<span class="lg-highlight-title lg-highlight-function">execute</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 <code class="leafygreen-ui-1l06pbn"> $sampleRate </code> operator can be used in a pipeline to select random documents from the collection. In this example we use <code class="leafygreen-ui-1l06pbn"> $sampleRate </code> to select about one third of the documents. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.collection.aggregate(\n [\n { $match: { $sampleRate: 0.33 } },\n { $count: \"numMatches\" }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">collection</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$match</span>: <!-- -->{ <span class="lg-highlight-attr">$sampleRate</span>: <span class="lg-highlight-number">0.33</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$count</span>: <span class="lg-highlight-string">"numMatches"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This is the output from 5 runs on the sample collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"numMatches\" : 38 }\n{ \"numMatches\" : 36 }\n{ \"numMatches\" : 29 }\n{ \"numMatches\" : 29 }\n{ \"numMatches\" : 28 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"numMatches"</span> <!-- -->: <span class="lg-highlight-number">38</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"numMatches"</span> <!-- -->: <span class="lg-highlight-number">36</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"numMatches"</span> <!-- -->: <span class="lg-highlight-number">29</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"numMatches"</span> <!-- -->: <span class="lg-highlight-number">29</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"numMatches"</span> <!-- -->: <span class="lg-highlight-number">28</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> <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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sample/#mongodb-pipeline-pipe.-sample"> <code class="leafygreen-ui-1l06pbn"> $sample </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/rand/#mongodb-query-op.-rand"> <code class="leafygreen-ui-1l06pbn"> $rand </code> </a> </p> </li> </ul> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/db.getLogComponents/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.getLogComponents() <a class="headerlink leafygreen-ui-1kepx47" href="#db.getlogcomponents--" 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.getlogcomponents--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#output" target="_self"> <span> Output </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.getLogComponents() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.getLogComponents" 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-method-db.getLogComponents"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns the current verbosity settings. The verbosity settings determine the amount of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/"> Log Messages </a> that MongoDB produces for each <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-message-components"> log message component <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If a component inherits the verbosity level of its parent, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.getLogComponents" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.getLogComponents() </code> </span> </a> displays <code class="leafygreen-ui-1l06pbn"> -1 </code> for the component's verbosity. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Output <a class="headerlink leafygreen-ui-1kepx47" href="#output" 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"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.getLogComponents" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.getLogComponents() </code> </span> </a> returns a document with the verbosity settings. For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"verbosity\" : 0,\n \"accessControl\" : {\n \"verbosity\" : -1\n },\n \"command\" : {\n \"verbosity\" : -1\n },\n \"control\" : {\n \"verbosity\" : -1\n },\n \"geo\" : {\n \"verbosity\" : -1\n },\n \"index\" : {\n \"verbosity\" : -1\n },\n \"network\" : {\n \"verbosity\" : -1\n },\n \"query\" : {\n \"verbosity\" : 2\n },\n \"replication\" : {\n \"verbosity\" : -1,\n \"election\" : {\n \"verbosity\" : -1\n },\n \"heartbeats\" : {\n \"verbosity\" : -1\n },\n \"initialSync\" : {\n \"verbosity\" : -1\n },\n \"rollback\" : {\n \"verbosity\" : -1\n }\n },\n \"sharding\" : {\n \"verbosity\" : -1\n },\n \"storage\" : {\n \"verbosity\" : 2,\n \"recovery\" : {\n \"verbosity\" : -1\n },\n \"journal\" : {\n \"verbosity\" : -1\n }\n },\n \"write\" : {\n \"verbosity\" : -1\n }\n}"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : 0,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "accessControl" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "command" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "control" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "geo" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "index" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "network" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "query" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : 2</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "replication" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "election" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "heartbeats" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "initialSync" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "rollback" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "sharding" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "storage" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : 2,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "recovery" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "journal" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "write" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "verbosity" : -1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To modify these settings, you can configure the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.verbosity </code> </a> and <code class="leafygreen-ui-1l06pbn"> systemLog.component.&lt;name&gt;.verbosity </code> settings in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#std-label-configuration-options"> configuration file </a> or set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.logComponentVerbosity"> <code class="leafygreen-ui-1l06pbn"> logComponentVerbosity </code> </a> parameter using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setParameter/#mongodb-dbcommand-dbcmd.setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> command or use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.setLogLevel/#mongodb-method-db.setLogLevel"> <code class="leafygreen-ui-1l06pbn"> db.setLogLevel() </code> </a> method. For examples, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-messages-configure-verbosity"> Configure Log Verbosity Levels <!-- --> . </a> </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/Bulk.toString/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Bulk.toString() <a class="headerlink leafygreen-ui-1kepx47" href="#bulk.tostring--" 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="bulk.tostring--"> </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="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> Bulk.toString() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-Bulk.toString" 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-method-Bulk.toString"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns as a string a JSON document that contains the number of operations and batches in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> object. </p> </dd> </dl> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following initializes a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> operations builder on the <code class="leafygreen-ui-1l06pbn"> items </code> collection, adds a series of write operations, and calls <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-Bulk.toString" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> Bulk.toString() </code> </span> </a> on the <code class="leafygreen-ui-1l06pbn"> bulk </code> builder object. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var bulk = db.items.initializeOrderedBulkOp();\nbulk.insert( { item: \"abc123\", status: \"A\", defaultQty: 500, points: 5 } );\nbulk.insert( { item: \"ijk123\", status: \"A\", defaultQty: 100, points: 10 } );\nbulk.find( { status: \"D\" } ).deleteOne();\nbulk.toString();\nbulk.execute()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> bulk <!-- -->= <!-- -->db.<span class="lg-highlight-property">items</span>.<span class="lg-highlight-title lg-highlight-function">initializeOrderedBulkOp</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bulk.<span class="lg-highlight-title lg-highlight-function">insert</span>( <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"abc123"</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"A"</span>, <span class="lg-highlight-attr">defaultQty</span>: <span class="lg-highlight-number">500</span>, <span class="lg-highlight-attr">points</span>: <span class="lg-highlight-number">5</span> } )<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bulk.<span class="lg-highlight-title lg-highlight-function">insert</span>( <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"ijk123"</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"A"</span>, <span class="lg-highlight-attr">defaultQty</span>: <span class="lg-highlight-number">100</span>, <span class="lg-highlight-attr">points</span>: <span class="lg-highlight-number">10</span> } )<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bulk.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"D"</span> } ).<span class="lg-highlight-title lg-highlight-function">deleteOne</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bulk.<span class="lg-highlight-title lg-highlight-function">toString</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bulk.<span class="lg-highlight-title lg-highlight-function">execute</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 <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-Bulk.toString" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> Bulk.toString() </code> </span> </a> returns the following JSON document </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n acknowledged: true,\n insertedCount: 2,\n insertedIds: [\n { index: 0, _id: ObjectId(\"627bf4f95e19ff3518448883\") },\n { index: 1, _id: ObjectId(\"627bf4f95e19ff3518448884\") }\n ],\n matchedCount: 0,\n modifiedCount: 0,\n deletedCount: 0,\n upsertedCount: 0,\n upsertedIds: []\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">acknowledged</span>: <span class="lg-highlight-literal">true</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">insertedCount</span>: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">insertedIds</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">index</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"627bf4f95e19ff3518448883"</span>) }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">index</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"627bf4f95e19ff3518448884"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">matchedCount</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">modifiedCount</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">deletedCount</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">upsertedCount</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">upsertedIds</span>: <!-- -->[<!-- -->]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <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/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> </p> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Reference <a class="headerlink leafygreen-ui-1kepx47" href="#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="reference"> </div> </a> </h1> <dl> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> Collation </a> </dt> <dd class="css-1ufxuu7"> Description of collation fields as well as supported languages and associated locales for collation. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string/#std-label-mongodb-uri"> Connection Strings </a> </dt> <dd class="css-1ufxuu7"> The complete specification of the MongoDB connection string format that the drivers use to describe connections to MongoDB deployments. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/#std-label-database-commands"> Database Commands </a> </dt> <dd class="css-1ufxuu7"> Documentation of all MongoDB <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-database-command"> database commands </a> operations, syntax, and use. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/default-mongodb-port/#std-label-default-mongodb-port"> Default MongoDB Port </a> </dt> <dd class="css-1ufxuu7"> List of default ports used by MongoDB. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-defaults/#std-label-default-mongodb-read-write-concerns"> Default MongoDB Read Concerns/Write Concerns </a> </dt> <dd class="css-1ufxuu7"> List of default read and write concerns. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/error-codes/#std-label-server-error-codes"> Error Codes </a> </dt> <dd class="css-1ufxuu7"> Details the error codes that MongoDB returns. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-label-glossary"> Glossary </a> </dt> <dd class="css-1ufxuu7"> A glossary of common terms and concepts specific to MongoDB. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-messages-ref"> Log Messages </a> </dt> <dd class="css-1ufxuu7"> Describes the components of log messages. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/limits/#std-label-server-limits-thresholds"> MongoDB Limits and Thresholds </a> </dt> <dd class="css-1ufxuu7"> A list of important limits and thresholds imposed by MongoDB. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-wire-protocol/#std-label-mongodb-wire-protocol"> MongoDB Wire Protocol </a> </dt> <dd class="css-1ufxuu7"> Description of the MongoDB Wire Protocol. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/#std-label-js-administrative-methods"> <code class="leafygreen-ui-1l06pbn"> mongosh </code> Methods </a> </dt> <dd class="css-1ufxuu7"> Documentation of JavaScript methods and helpers 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> </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/#std-label-operator-ref-landing"> Operators </a> </dt> <dd class="css-1ufxuu7"> Documentation of query, update, projection, and aggregation framework operators. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/server-sessions/#std-label-server-sessions"> Server Sessions </a> </dt> <dd class="css-1ufxuu7"> Describes server sessions. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/sbe/#std-label-sbe-landing"> Slot-Based Query Execution Engine </a> </dt> <dd class="css-1ufxuu7"> Describes the slot-based query execution engine. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/stable-api/#std-label-stable-api"> Stable API </a> </dt> <dd class="css-1ufxuu7"> Describes the Stable API. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#std-label-metadata-system-collections"> System Collections </a> </dt> <dd class="css-1ufxuu7"> Describes the collections that MongoDB reserves for internal use. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#std-label-mongo"> mongo </a> </dt> <dd class="css-1ufxuu7"> Documentation of JavaScript methods and helpers 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. </dd> </dl> <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"> The following pages contain additional reference material: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/applications/data-models/#std-label-data-modeling-patterns"> Data Model Examples and Patterns </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/sharding/#std-label-sharding-reference"> Sharding Reference </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replication/#std-label-replication-toc"> Self-Managed Replication Reference </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/security/#std-label-security-reference"> Security Reference for Self-Managed Deployments </a> </p> </li> </ul> </div> </div> </section>
https://www.mongodb.com/docs/manual/reference/method/cursor.comment/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> cursor.comment() <a class="headerlink leafygreen-ui-1kepx47" href="#cursor.comment--" 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="cursor.comment--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#output-examples" target="_self"> <span> Output Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> cursor.comment() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-cursor.comment" 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-method-cursor.comment"> </div> </a> </dt> <dd> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> mongosh Method </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page documents 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> method. This is <em> not </em> the documentation for a language-specific driver, such as Node.js. </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB API drivers, refer to the language-specific <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB driver documentation <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Adds a <code class="leafygreen-ui-1l06pbn"> comment </code> field to the query. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-cursor.comment" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> cursor.comment() </code> </span> </a> has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor.comment( &lt;string&gt; )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor.<span class="lg-highlight-title lg-highlight-function">comment</span>( &lt;<!-- -->string<!-- -->&gt; <!-- -->)</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"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-cursor.comment" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> comment() </code> </span> </a> has the following parameter: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> comment </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The comment to apply to the query. </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-cursor.comment" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> comment() </code> </span> </a> associates a comment string with the find operation. This can make it easier to track a particular query in the following diagnostic outputs: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile"> <code class="leafygreen-ui-1l06pbn"> system.profile </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#mongodb-data-QUERY"> <code class="leafygreen-ui-1l06pbn"> QUERY </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-messages-ref"> log </a> component </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.currentOp/#mongodb-method-db.currentOp"> <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-messages-configure-verbosity"> configure log verbosity </a> for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> log, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-the-database-profiler/#std-label-database-profiler"> Database Profiler tutorial </a> , or the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.currentOp/#mongodb-method-db.currentOp"> <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> </a> command. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following operation attaches a comment to a query on the <code class="leafygreen-ui-1l06pbn"> restaurants </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.restaurants.find(\n { \"borough\" : \"Manhattan\" }\n).comment( \"Find all Manhattan restaurants\" )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">restaurants</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Manhattan"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">).<span class="lg-highlight-title lg-highlight-function">comment</span>( <span class="lg-highlight-string">"Find all Manhattan restaurants"</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> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Output Examples <a class="headerlink leafygreen-ui-1kepx47" href="#output-examples" 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-examples"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile"> <code class="leafygreen-ui-1l06pbn"> system.profile </code> </a> <a class="headerlink leafygreen-ui-1kepx47" href="#system.profile" 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="system.profile"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following is an excerpt from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile"> <code class="leafygreen-ui-1l06pbn"> system.profile </code> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"op\" : \"query\",\n \"ns\" : \"guidebook.restaurant\",\n \"query\" : {\n \"find\" : \"restaurant\",\n \"filter\" : {\n \"borough\" : \"Manhattan\"\n },\n \"comment\" : \"Find all Manhattan restaurants\"\n },\n ...\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"op"</span> <!-- -->: <span class="lg-highlight-string">"query"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ns"</span> <!-- -->: <span class="lg-highlight-string">"guidebook.restaurant"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"query"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"find"</span> <!-- -->: <span class="lg-highlight-string">"restaurant"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"filter"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Manhattan"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"comment"</span> <!-- -->: <span class="lg-highlight-string">"Find all Manhattan restaurants"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-messages-ref"> log </a> <a class="headerlink leafygreen-ui-1kepx47" href="#log" 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="log"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following is an excerpt from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> log. It has been formatted for readability. </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 verbosity level for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#mongodb-data-QUERY"> <code class="leafygreen-ui-1l06pbn"> QUERY </code> </a> must be greater than <code class="leafygreen-ui-1l06pbn"> 0 </code> . See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-messages-configure-verbosity"> Configure Log Verbosity Levels </a> </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"2015-11-23T13:09:16.202-05:00 I COMMAND [conn1]\n command guidebook.restaurant command: find {\n find: \"restaurant\",\n filter: { \"borough\" : \"Manhattan\" },\n comment: \"Find all Manhattan restaurants\"\n }\n ...","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-number">2015</span>-<span class="lg-highlight-number">11</span>-<!-- -->23<span class="lg-highlight-attr">T13</span>:<span class="lg-highlight-number">09</span>:<span class="lg-highlight-number">16.202</span>-<span class="lg-highlight-number">05</span>:<span class="lg-highlight-number">00</span> I <span class="lg-highlight-variable lg-highlight-constant">COMMAND</span> <!-- -->[<!-- -->conn1]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> command guidebook.<span class="lg-highlight-property">restaurant</span> <span class="lg-highlight-attr">command</span>: <!-- -->find <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">find</span>: <span class="lg-highlight-string">"restaurant"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">filter</span>: <!-- -->{ <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Manhattan"</span> }<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">comment</span>: <span class="lg-highlight-string">"Find all Manhattan restaurants"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.currentOp/#mongodb-method-db.currentOp"> <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> </a> <a class="headerlink leafygreen-ui-1kepx47" href="#unnamed" 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="unnamed"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Suppose the following operation is currently running on a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.restaurants.find(\n { \"borough\" : \"Manhattan\" }\n).comment(\"Find all Manhattan restaurants\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">restaurants</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Manhattan"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">).<span class="lg-highlight-title lg-highlight-function">comment</span>(<span class="lg-highlight-string">"Find all Manhattan restaurants"</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"> Running the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.currentOp/#mongodb-method-db.currentOp"> <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> </a> command returns the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"inprog\" : [\n {\n \"host\" : \"198.51.100.1:27017\",\n \"desc\" : \"conn3\",\n \"connectionId\" : 3,\n ...\n\n \"op\" : \"query\",\n \"ns\" : \"test.$cmd\",\n \"command\" : {\n \"find\" : \"restaurants\",\n \"filter\" : {\n \"borough\" : \"Manhattan\"\n },\n \"comment\" : \"Find all Manhattan restaurants\",\n \"$db\" : \"test\"\n },\n \"numYields\" : 0,\n ...\n }\n ],\n \"ok\" : 1\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"inprog"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"host"</span> <!-- -->: <span class="lg-highlight-string">"198.51.100.1:27017"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"desc"</span> <!-- -->: <span class="lg-highlight-string">"conn3"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"connectionId"</span> <!-- -->: <span class="lg-highlight-number">3</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"op"</span> <!-- -->: <span class="lg-highlight-string">"query"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ns"</span> <!-- -->: <span class="lg-highlight-string">"test.$cmd"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"command"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"find"</span> <!-- -->: <span class="lg-highlight-string">"restaurants"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"filter"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Manhattan"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"comment"</span> <!-- -->: <span class="lg-highlight-string">"Find all Manhattan restaurants"</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$db"</span> <!-- -->: <span class="lg-highlight-string">"test"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"numYields"</span> <!-- -->: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ok"</span> <!-- -->: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/split/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $split (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-split--aggregation-" 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="-split--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $split </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-split" 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-expression-exp.-split"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Divides a string into an array of substrings based on a delimiter. <code class="leafygreen-ui-1l06pbn"> $split </code> removes the delimiter and returns the resulting substrings as elements of an array. If the delimiter is not found in the string, <code class="leafygreen-ui-1l06pbn"> $split </code> returns the original string as the only element of an array. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $split </code> has the following <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-agg-quick-ref-operator-expressions"> operator expression syntax <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $split: [ &lt;string&gt;, &lt;delimiter&gt; ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$split</span>: <!-- -->[ <!-- -->&lt;string expression&gt;, &lt;delimiter&gt; ] }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> string expression </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The string to be split. <code class="leafygreen-ui-1l06pbn"> string expression </code> can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> as long as it resolves to a string. For more information on expressions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> Expression Operators <!-- --> . </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> delimiter </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The delimiter to use when splitting the string expression. <code class="leafygreen-ui-1l06pbn"> delimiter </code> can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> as long as it resolves to a string. </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-split" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $split </code> </span> </a> operator returns an array. The <code class="leafygreen-ui-1l06pbn"> &lt;string expression&gt; </code> and <code class="leafygreen-ui-1l06pbn"> &lt;delimiter&gt; </code> inputs must both be strings. Otherwise, the operation fails with an error. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:55%"/> <col style="width:45%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Results </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $split: [ \"June-15-2013\", \"-\" ] }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$split</span>: <!-- -->[ <span class="lg-highlight-string">"June-15-2013"</span>, <span class="lg-highlight-string">"-"</span> ] }</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":"[ \"June\", \"15\", \"2013\" ]","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ <span class="lg-highlight-string">"June"</span>, <span class="lg-highlight-string">"15"</span>, <span class="lg-highlight-string">"2013"</span> ]</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $split: [ \"banana split\", \"a\" ] }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$split</span>: <!-- -->[ <span class="lg-highlight-string">"banana split"</span>, <span class="lg-highlight-string">"a"</span> ] }</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":"[ \"b\", \"n\", \"n\", \" split\" ]","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ <span class="lg-highlight-string">"b"</span>, <span class="lg-highlight-string">"n"</span>, <span class="lg-highlight-string">"n"</span>, <span class="lg-highlight-string">" split"</span> ]</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $split: [ \"Hello World\", \" \" ] }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$split</span>: <!-- -->[ <span class="lg-highlight-string">"Hello World"</span>, <span class="lg-highlight-string">" "</span> ] }</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":"[ \"Hello\", \"World\" ]","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ <span class="lg-highlight-string">"Hello"</span>, <span class="lg-highlight-string">"World"</span> ]</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $split: [ \"astronomical\", \"astro\" ] }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$split</span>: <!-- -->[ <span class="lg-highlight-string">"astronomical"</span>, <span class="lg-highlight-string">"astro"</span> ] }</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":"[ \"\", \"nomical\" ]","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ <span class="lg-highlight-string">""</span>, <span class="lg-highlight-string">"nomical"</span> ]</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $split: [ \"pea green boat\", \"owl\" ] }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$split</span>: <!-- -->[ <span class="lg-highlight-string">"pea green boat"</span>, <span class="lg-highlight-string">"owl"</span> ] }</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":"[ \"pea green boat\" ]","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ <span class="lg-highlight-string">"pea green boat"</span> ]</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $split: [ "headphone jack", 7 ] } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Errors with message: </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "$split requires an expression that evaluates to a string as a second argument, found: double" </code> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $split: [ "headphone jack", /jack/ ] } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Errors with message: </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "$split requires an expression that evaluates to a string as a second argument, found: regex" </code> </p> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A collection named <code class="leafygreen-ui-1l06pbn"> deliveries </code> contains the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.deliveries.insertMany( [\n { _id: 1, city: \"Berkeley, CA\", qty: 648 },\n { _id: 2, city: \"Bend, OR\", qty: 491 },\n { _id: 3, city: \"Kensington, CA\", qty: 233 },\n { _id: 4, city: \"Eugene, OR\", qty: 842 },\n { _id: 5, city: \"Reno, NV\", qty: 655 },\n { _id: 6, city: \"Portland, OR\", qty: 408 },\n { _id: 7, city: \"Sacramento, CA\", qty: 574 }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">deliveries</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-string">"Berkeley, CA"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">648</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-string">"Bend, OR"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">491</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-string">"Kensington, CA"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">233</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-string">"Eugene, OR"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">842</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-string">"Reno, NV"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">655</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-string">"Portland, OR"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">408</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">7</span>, <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-string">"Sacramento, CA"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">574</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The goal of following aggregation operation is to find the total quantity of deliveries for each state and sort the list in descending order. It has five pipeline stages: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/project/#mongodb-pipeline-pipe.-project"> <code class="leafygreen-ui-1l06pbn"> $project </code> </a> stage produces documents with two fields, <code class="leafygreen-ui-1l06pbn"> qty </code> (integer) and <code class="leafygreen-ui-1l06pbn"> city_state </code> (array). The <code class="leafygreen-ui-1l06pbn"> $split </code> operator creates an array of strings by splitting the <code class="leafygreen-ui-1l06pbn"> city </code> field, using a comma followed by a space ( <code class="leafygreen-ui-1l06pbn"> ", " </code> ) as a delimiter. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/unwind/#mongodb-pipeline-pipe.-unwind"> <code class="leafygreen-ui-1l06pbn"> $unwind </code> </a> stage creates a separate record for each element in the <code class="leafygreen-ui-1l06pbn"> city_state </code> field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/match/#mongodb-pipeline-pipe.-match"> <code class="leafygreen-ui-1l06pbn"> $match </code> </a> stage uses a regular expression to filter out the city documents, leaving only those containing a state. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> stage groups all the states together and sums the <code class="leafygreen-ui-1l06pbn"> qty </code> field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sort/#mongodb-pipeline-pipe.-sort"> <code class="leafygreen-ui-1l06pbn"> $sort </code> </a> stage sorts the results by <code class="leafygreen-ui-1l06pbn"> total_qty </code> in descending order. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.deliveries.aggregate( [\n { $project: { city_state: { $split: [\"$city\", \", \"] }, qty: 1 } },\n { $unwind: \"$city_state\" },\n { $match: { city_state: /[A-Z]{2}/ } },\n { $group: { _id: { state: \"$city_state\" }, total_qty: { $sum: \"$qty\" } } },\n { $sort: { total_qty: -1 } }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">deliveries</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$project</span>: <!-- -->{ <span class="lg-highlight-attr">city_state</span>: <!-- -->{ <span class="lg-highlight-attr">$split</span>: <!-- -->[<span class="lg-highlight-string">"$city"</span>, <span class="lg-highlight-string">", "</span>] }<!-- -->, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">1</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$unwind</span>: <span class="lg-highlight-string">"$city_state"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$match</span>: <!-- -->{ <span class="lg-highlight-attr">city_state</span>: <span class="lg-highlight-regexp">/</span><span class="lg-highlight-regexp">[A-Z]</span><span class="lg-highlight-regexp">{2}/</span> <!-- -->} }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$group</span>: <!-- -->{ <span class="lg-highlight-attr">_id</span>: <!-- -->{ <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"$city_state"</span> }<!-- -->, <span class="lg-highlight-attr">total_qty</span>: <!-- -->{ <span class="lg-highlight-attr">$sum</span>: <span class="lg-highlight-string">"$qty"</span> } } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$sort</span>: <!-- -->{ <span class="lg-highlight-attr">total_qty</span>: <!-- -->-<span class="lg-highlight-number">1</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n { _id: { state: \"OR\" }, total_qty: 1741 },\n { _id: { state: \"CA\" }, total_qty: 1455 },\n { _id: { state: \"NV\" }, total_qty: 655 }\n]","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <!-- -->{ <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"OR"</span> }<!-- -->, <span class="lg-highlight-attr">total_qty</span>: <span class="lg-highlight-number">1741</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <!-- -->{ <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span> }<!-- -->, <span class="lg-highlight-attr">total_qty</span>: <span class="lg-highlight-number">1455</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <!-- -->{ <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"NV"</span> }<!-- -->, <span class="lg-highlight-attr">total_qty</span>: <span class="lg-highlight-number">655</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/percentile/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $percentile (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-percentile--aggregation-" 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="-percentile--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#command-fields" target="_self"> <span> Command Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </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"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="group"> <dt> <code class="leafygreen-ui-1l06pbn"> $percentile </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-group-grp.-percentile" 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-group-grp.-percentile"> </div> </a> </dt> <dd> <div> <p> <em> New <!-- --> in version <!-- --> 7.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Returns an array of scalar values that correspond to specified <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-percentile"> percentile </a> values. </p> <p class="leafygreen-ui-1kp3ins"> You can use <code class="leafygreen-ui-1l06pbn"> $percentile </code> as an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#std-label-accumulators-group"> accumulator </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> stage or as an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> aggegation expression <!-- --> . </a> </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The syntax for <code class="leafygreen-ui-1l06pbn"> $percentile </code> is: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n $percentile: {\n input: &lt;expression&gt;,\n p: [ &lt;expression1&gt;, &lt;expression2&gt;, ... ],\n method: &lt;string&gt;\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$percentile</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">input</span>: &lt;<!-- -->expression<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">p</span>: <!-- -->[ &lt;<!-- -->expression1<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->expression2<!-- -->&gt;<!-- -->,<!-- --> <!-- -->...<!-- --> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">method</span>: &lt;<!-- -->string<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Command Fields <a class="headerlink leafygreen-ui-1kepx47" href="#command-fields" 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="command-fields"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $percentile </code> takes the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:15%"/> <col style="width:17%"/> <col style="width:17%"/> <col style="width:51%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Necessity </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> input </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Expression </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Required </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> $percentile </code> calculates the percentile values of this data. <code class="leafygreen-ui-1l06pbn"> input </code> must be a field name or an expression that evaluates to a numeric type. If the expression cannot be converted to a numeric type, the <code class="leafygreen-ui-1l06pbn"> $percentile </code> calculation ignores it. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> p </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Expression </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Required </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $percentile </code> calculates a percentile value for each element in <code class="leafygreen-ui-1l06pbn"> p </code> . The elements represent percentages and must evaluate to numeric values in the range <code class="leafygreen-ui-1l06pbn"> 0.0 </code> to <code class="leafygreen-ui-1l06pbn"> 1.0 </code> , inclusive. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $percentile </code> returns results in the same order as the elements in <code class="leafygreen-ui-1l06pbn"> p </code> . </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> method </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> String </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Required </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The method that <code class="leafygreen-ui-1l06pbn"> mongod </code> uses to calculate the percentile value. The method must be <code class="leafygreen-ui-1l06pbn"> 'approximate' </code> . </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can use <code class="leafygreen-ui-1l06pbn"> $percentile </code> in: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> stages as an accumulator </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stages as an accumulator </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/project/#mongodb-pipeline-pipe.-project"> <code class="leafygreen-ui-1l06pbn"> $project </code> </a> stages as an aggregation expression </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $percentile </code> has the following characteristics as an accumulator, it: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Calculates a single result for all the documents in the stage. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://arxiv.org/abs/1902.04023" rel="noopener noreferrer"> <span> t-digest </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> algorithm to calculate approximate, percentile based metrics. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses approximate methods to scale to large volumes of data. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $percentile </code> has the following characteristics as an aggregation expression, it: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Accepts an array as input </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Calculates a separate result for each input document </p> </li> </ul> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Type of Operation <a class="headerlink leafygreen-ui-1kepx47" href="#type-of-operation" 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="type-of-operation"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> In a <code class="leafygreen-ui-1l06pbn"> $group </code> stage, <code class="leafygreen-ui-1l06pbn"> $percentile </code> is an accumulator and calculates a value for all documents in the window. </p> <p class="leafygreen-ui-1kp3ins"> In a <code class="leafygreen-ui-1l06pbn"> $project </code> stage, <code class="leafygreen-ui-1l06pbn"> $percentile </code> is an aggregation expression and calculates values for each document. </p> <p class="leafygreen-ui-1kp3ins"> In <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> stages, <code class="leafygreen-ui-1l06pbn"> $percentile </code> returns a result for each document like an aggregation expression, but the results are computed over groups of documents like an accumulator. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-percentile-calculation-considerations"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Calculation Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#calculation-considerations" 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="calculation-considerations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> In <code class="leafygreen-ui-1l06pbn"> $group </code> stages, <code class="leafygreen-ui-1l06pbn"> $percentile </code> always uses an approximate calculation method. </p> <p class="leafygreen-ui-1kp3ins"> In <code class="leafygreen-ui-1l06pbn"> $project </code> stages, <code class="leafygreen-ui-1l06pbn"> $percentile </code> might use the discrete calculation method even when the approximate method is specified. </p> <p class="leafygreen-ui-1kp3ins"> In <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> stages, the workload determines the calculation method that <code class="leafygreen-ui-1l06pbn"> $percentile </code> uses. </p> <p class="leafygreen-ui-1kp3ins"> The computed percentiles <code class="leafygreen-ui-1l06pbn"> $percentile </code> returns might vary, even on the same datasets. This is because the algorithm calculates approximate values. </p> <p class="leafygreen-ui-1kp3ins"> Duplicate samples can cause ambiguity. If there are a large number of duplicates, the percentile values may not represent the actual sample distribution. Consider a data set where all the samples are the same. All of the values in the data set fall at or below any percentile. A "50th percentile" value would actually represent either 0 or 100 percent of the samples. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $percentile </code> returns the minimum value for <code class="leafygreen-ui-1l06pbn"> p = 0.0 </code> . </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $percentile </code> returns the maximum value for <code class="leafygreen-ui-1l06pbn"> p = 1.0 </code> . </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Array Input <a class="headerlink leafygreen-ui-1kepx47" href="#array-input" 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="array-input"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you use <code class="leafygreen-ui-1l06pbn"> $percentile </code> as an aggregation expression in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/project/#mongodb-pipeline-pipe.-project"> <code class="leafygreen-ui-1l06pbn"> $project </code> </a> stage, you can use an array as input. The syntax is: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n $percentile: {\n input: [ &lt;expression1,&gt;, .., &lt;expressionn&gt; ],\n p: [ &lt;expression1&gt;, &lt;expression2&gt;, ... ],\n method: &lt;string&gt;\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$percentile</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">input</span>: <!-- -->[ &lt;<!-- -->expression1<!-- -->, &lt;<!-- -->expression2<!-- -->&gt;<!-- -->,<!-- --> <!-- -->..<!-- -->, &lt;<!-- -->expressionN<!-- -->&gt; <!-- -->]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">p</span>: <!-- -->[ &lt;<!-- -->expression1<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->expression2<!-- -->&gt;<!-- -->,<!-- --> <!-- -->...<!-- --> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">method</span>: &lt;<!-- -->string<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Window Functions <a class="headerlink leafygreen-ui-1kepx47" href="#window-functions" 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="window-functions"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> A window function lets you calculate results over a moving "window" of neighboring documents. As each document passes though the pipeline, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Recomputes the set of documents in the current window </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> calculates a value for all documents in the set </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> returns a single value for that document </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> You can use <code class="leafygreen-ui-1l06pbn"> $percentile </code> in a <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> stage to calculate rolling statistics for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-manual-timeseries-landing"> time series </a> or other related data. </p> <p class="leafygreen-ui-1kp3ins"> When you use <code class="leafygreen-ui-1l06pbn"> $percentile </code> in a <code class="leafygreen-ui-1l06pbn"> $setWindowField </code> stage, the <code class="leafygreen-ui-1l06pbn"> input </code> value must be a field name. If you enter an array instead of a field name, the operation fails. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following examples use the <code class="leafygreen-ui-1l06pbn"> testScores </code> collection. Create the collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.testScores.insertMany( [\n { studentId: \"2345\", test01: 62, test02: 81, test03: 80 },\n { studentId: \"2356\", test01: 60, test02: 83, test03: 79 },\n { studentId: \"2358\", test01: 67, test02: 82, test03: 78 },\n { studentId: \"2367\", test01: 64, test02: 72, test03: 77 },\n { studentId: \"2369\", test01: 60, test02: 53, test03: 72 }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">testScores</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">"2345"</span>, <span class="lg-highlight-attr">test01</span>: <span class="lg-highlight-number">62</span>, <span class="lg-highlight-attr">test02</span>: <span class="lg-highlight-number">81</span>, <span class="lg-highlight-attr">test03</span>: <span class="lg-highlight-number">80</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">"2356"</span>, <span class="lg-highlight-attr">test01</span>: <span class="lg-highlight-number">60</span>, <span class="lg-highlight-attr">test02</span>: <span class="lg-highlight-number">83</span>, <span class="lg-highlight-attr">test03</span>: <span class="lg-highlight-number">79</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">"2358"</span>, <span class="lg-highlight-attr">test01</span>: <span class="lg-highlight-number">67</span>, <span class="lg-highlight-attr">test02</span>: <span class="lg-highlight-number">82</span>, <span class="lg-highlight-attr">test03</span>: <span class="lg-highlight-number">78</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">"2367"</span>, <span class="lg-highlight-attr">test01</span>: <span class="lg-highlight-number">64</span>, <span class="lg-highlight-attr">test02</span>: <span class="lg-highlight-number">72</span>, <span class="lg-highlight-attr">test03</span>: <span class="lg-highlight-number">77</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">"2369"</span>, <span class="lg-highlight-attr">test01</span>: <span class="lg-highlight-number">60</span>, <span class="lg-highlight-attr">test02</span>: <span class="lg-highlight-number">53</span>, <span class="lg-highlight-attr">test03</span>: <span class="lg-highlight-number">72</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Calculate a Single Value as an Accumulator <a class="headerlink leafygreen-ui-1kepx47" href="#calculate-a-single-value-as-an-accumulator" 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="calculate-a-single-value-as-an-accumulator"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Create an accumulator that calculates a single percentile value: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.testScores.aggregate( [\n {\n $group: {\n _id: null,\n test01_percentiles: {\n $percentile: {\n input: \"$test01\",\n p: [ 0.95 ],\n method: 'approximate'\n }\n },\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">testScores</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$group</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-literal">null</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">test01_percentiles</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$percentile</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">input</span>: <span class="lg-highlight-string">"$test01"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">p</span>: <!-- -->[ <span class="lg-highlight-number">0.95</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">method</span>: <span class="lg-highlight-string">'approximate'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ _id: null, test01_percentiles: [ 67 ] }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-literal">null</span>, <span class="lg-highlight-attr">test01_percentiles</span>: <!-- -->[ <span class="lg-highlight-number">67</span> ] }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> _id </code> field value is <code class="leafygreen-ui-1l06pbn"> null </code> so <code class="leafygreen-ui-1l06pbn"> $group </code> selects all the documents in the collection. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> percentile </code> accumulator takes its input data from the <code class="leafygreen-ui-1l06pbn"> test01 </code> field. </p> <p class="leafygreen-ui-1kp3ins"> In this example, the percentiles array, <code class="leafygreen-ui-1l06pbn"> p </code> , has one value so the <code class="leafygreen-ui-1l06pbn"> $percentile </code> operator only calculates one term for the <code class="leafygreen-ui-1l06pbn"> test01 </code> data. The 95th percentile value is <code class="leafygreen-ui-1l06pbn"> 67 </code> . </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Calculate Multiple Values as an Accumulator <a class="headerlink leafygreen-ui-1kepx47" href="#calculate-multiple-values-as-an-accumulator" 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="calculate-multiple-values-as-an-accumulator"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Create an accumulator that calculates multiple percentile values: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.testScores.aggregate( [\n {\n $group: {\n _id: null,\n test01_percentiles: {\n $percentile: {\n input: \"$test01\",\n p: [ 0.5, 0.75, 0.9, 0.95 ],\n method: 'approximate'\n }\n },\n test02_percentiles: {\n $percentile: {\n input: \"$test02\",\n p: [ 0.5, 0.75, 0.9, 0.95 ],\n method: 'approximate'\n }\n },\n test03_percentiles: {\n $percentile: {\n input: \"$test03\",\n p: [ 0.5, 0.75, 0.9, 0.95 ],\n method: 'approximate'\n }\n },\n test03_percent_alt: {\n $percentile: {\n input: \"$test03\",\n p: [ 0.9, 0.5, 0.75, 0.95 ],\n method: 'approximate'\n }\n },\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">testScores</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$group</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-literal">null</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">test01_percentiles</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$percentile</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">input</span>: <span class="lg-highlight-string">"$test01"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">p</span>: <!-- -->[ <span class="lg-highlight-number">0.5</span>, <span class="lg-highlight-number">0.75</span>, <span class="lg-highlight-number">0.9</span>, <span class="lg-highlight-number">0.95</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">method</span>: <span class="lg-highlight-string">'approximate'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">test02_percentiles</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$percentile</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">input</span>: <span class="lg-highlight-string">"$test02"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">p</span>: <!-- -->[ <span class="lg-highlight-number">0.5</span>, <span class="lg-highlight-number">0.75</span>, <span class="lg-highlight-number">0.9</span>, <span class="lg-highlight-number">0.95</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">method</span>: <span class="lg-highlight-string">'approximate'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">test03_percentiles</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$percentile</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">input</span>: <span class="lg-highlight-string">"$test03"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">p</span>: <!-- -->[ <span class="lg-highlight-number">0.5</span>, <span class="lg-highlight-number">0.75</span>, <span class="lg-highlight-number">0.9</span>, <span class="lg-highlight-number">0.95</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">method</span>: <span class="lg-highlight-string">'approximate'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">test03_percent_alt</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$percentile</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">input</span>: <span class="lg-highlight-string">"$test03"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">p</span>: <!-- -->[ <span class="lg-highlight-number">0.9</span>, <span class="lg-highlight-number">0.5</span>, <span class="lg-highlight-number">0.75</span>, <span class="lg-highlight-number">0.95</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">method</span>: <span class="lg-highlight-string">'approximate'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: null,\n test01_percentiles: [ 62, 64, 67, 67 ],\n test02_percentiles: [ 81, 82, 83, 83 ],\n test03_percentiles: [ 78, 79, 80, 80 ],\n test03_percent_alt: [ 80, 78, 79, 80 ]\n}"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> _id: null,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> test01_percentiles: [ 62, 64, 67, 67 ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> test02_percentiles: [ 81, 82, 83, 83 ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> test03_percentiles: [ 78, 79, 80, 80 ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> test03_percent_alt: [ 80, 78, 79, 80 ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> _id </code> field value is <code class="leafygreen-ui-1l06pbn"> null </code> so <code class="leafygreen-ui-1l06pbn"> $group </code> selects all the documents in the collection. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> percentile </code> accumulator calculates values for three fields, <code class="leafygreen-ui-1l06pbn"> test01 </code> , <code class="leafygreen-ui-1l06pbn"> test02 </code> , and <code class="leafygreen-ui-1l06pbn"> test03 </code> . </p> <p class="leafygreen-ui-1kp3ins"> The accumulator calculates the 50th, 75th, 90th, and 95th percentile values for each input field. </p> <p class="leafygreen-ui-1kp3ins"> The percentile values are returned in the same order as the elements of <code class="leafygreen-ui-1l06pbn"> p </code> . The values in <code class="leafygreen-ui-1l06pbn"> test03_percentiles </code> and <code class="leafygreen-ui-1l06pbn"> test03_percent_alt </code> are the same, but their order is different. The order of elements in each result array matches the corresponding order of elements in <code class="leafygreen-ui-1l06pbn"> p </code> . </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use <code class="leafygreen-ui-1l06pbn"> $percentile </code> in a <code class="leafygreen-ui-1l06pbn"> $project </code> Stage <a class="headerlink leafygreen-ui-1kepx47" href="#use-operatorname-in-a--project-stage" 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-operatorname-in-a--project-stage"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> In a <code class="leafygreen-ui-1l06pbn"> $project </code> stage, <code class="leafygreen-ui-1l06pbn"> $percentile </code> is an aggregation expression and calculates values for each document. </p> <p class="leafygreen-ui-1kp3ins"> You can use a field name or an array as input in a <code class="leafygreen-ui-1l06pbn"> $project </code> stage. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.testScores.aggregate( [\n {\n $project: {\n _id: 0,\n studentId: 1,\n testPercentiles: {\n $percentile: {\n input: [ \"$test01\", \"$test02\", \"$test03\" ],\n p: [ 0.5, 0.95 ],\n method: 'approximate'\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">testScores</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">testPercentiles</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$percentile</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">input</span>: <!-- -->[ <span class="lg-highlight-string">"$test01"</span>, <span class="lg-highlight-string">"$test02"</span>, <span class="lg-highlight-string">"$test03"</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">p</span>: <!-- -->[ <span class="lg-highlight-number">0.5</span>, <span class="lg-highlight-number">0.95</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">method</span>: <span class="lg-highlight-string">'approximate'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ studentId: '2345', testPercentiles: [ 80, 81 ] },\n{ studentId: '2356', testPercentiles: [ 79, 83 ] },\n{ studentId: '2358', testPercentiles: [ 78, 82 ] },\n{ studentId: '2367', testPercentiles: [ 72, 77 ] },\n{ studentId: '2369', testPercentiles: [ 60, 72 ] }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">'2345'</span>, <span class="lg-highlight-attr">testPercentiles</span>: <!-- -->[ <span class="lg-highlight-number">80</span>, <span class="lg-highlight-number">81</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">'2356'</span>, <span class="lg-highlight-attr">testPercentiles</span>: <!-- -->[ <span class="lg-highlight-number">79</span>, <span class="lg-highlight-number">83</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">'2358'</span>, <span class="lg-highlight-attr">testPercentiles</span>: <!-- -->[ <span class="lg-highlight-number">78</span>, <span class="lg-highlight-number">82</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">'2367'</span>, <span class="lg-highlight-attr">testPercentiles</span>: <!-- -->[ <span class="lg-highlight-number">72</span>, <span class="lg-highlight-number">77</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">'2369'</span>, <span class="lg-highlight-attr">testPercentiles</span>: <!-- -->[ <span class="lg-highlight-number">60</span>, <span class="lg-highlight-number">72</span> ] }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> When <code class="leafygreen-ui-1l06pbn"> $percentile </code> is an aggregation expression there is a result for each <code class="leafygreen-ui-1l06pbn"> studentId </code> . </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use <code class="leafygreen-ui-1l06pbn"> $percentile </code> in a <code class="leafygreen-ui-1l06pbn"> $setWindowField </code> Stage <a class="headerlink leafygreen-ui-1kepx47" href="#use-operatorname-in-a--setwindowfield-stage" 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-operatorname-in-a--setwindowfield-stage"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To base your percentile values on local data trends, use <code class="leafygreen-ui-1l06pbn"> $percentile </code> in a <code class="leafygreen-ui-1l06pbn"> $setWindowField </code> aggregation pipeline stage. </p> <p class="leafygreen-ui-1kp3ins"> This example creates a window to filter scores: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.testScores.aggregate( [\n {\n $setWindowFields: {\n sortBy: { test01: 1 },\n output: {\n test01_95percentile: {\n $percentile: {\n input: \"$test01\",\n p: [ 0.95 ],\n method: 'approximate'\n },\n window: {\n range: [ -3, 3 ]\n }\n }\n }\n }\n },\n {\n $project: {\n _id: 0,\n studentId: 1,\n test01_95percentile: 1\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">testScores</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">test01</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">test01_95percentile</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$percentile</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">input</span>: <span class="lg-highlight-string">"$test01"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">p</span>: <!-- -->[ <span class="lg-highlight-number">0.95</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">method</span>: <span class="lg-highlight-string">'approximate'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">window</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">range</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">3</span>, <span class="lg-highlight-number">3</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">test01_95percentile</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ studentId: '2356', test01_95percentile: [ 62 ] },\n{ studentId: '2369', test01_95percentile: [ 62 ] },\n{ studentId: '2345', test01_95percentile: [ 64 ] },\n{ studentId: '2367', test01_95percentile: [ 67 ] },\n{ studentId: '2358', test01_95percentile: [ 67 ] }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">'2356'</span>, <span class="lg-highlight-attr">test01_95percentile</span>: <!-- -->[ <span class="lg-highlight-number">62</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">'2369'</span>, <span class="lg-highlight-attr">test01_95percentile</span>: <!-- -->[ <span class="lg-highlight-number">62</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">'2345'</span>, <span class="lg-highlight-attr">test01_95percentile</span>: <!-- -->[ <span class="lg-highlight-number">64</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">'2367'</span>, <span class="lg-highlight-attr">test01_95percentile</span>: <!-- -->[ <span class="lg-highlight-number">67</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">studentId</span>: <span class="lg-highlight-string">'2358'</span>, <span class="lg-highlight-attr">test01_95percentile</span>: <!-- -->[ <span class="lg-highlight-number">67</span> ] }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In this example, the percentile calculation for each document also incorporates data from the three documents before and after it. </p> </section> </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"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/median/#mongodb-group-grp.-median"> <code class="leafygreen-ui-1l06pbn"> $median </code> </a> operator is a special case of the <code class="leafygreen-ui-1l06pbn"> $percentile </code> operator that uses a fixed value of <code class="leafygreen-ui-1l06pbn"> p: [ 0.5 ] </code> . </p> <p class="leafygreen-ui-1kp3ins"> For more information on window functions, see: <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> . </a> </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/db.collection.reIndex/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.collection.reIndex() <a class="headerlink leafygreen-ui-1kepx47" href="#db.collection.reindex--" 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.collection.reindex--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.collection.reIndex() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.collection.reIndex" 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-method-db.collection.reIndex"> </div> </a> </dt> <dd> <div> <p> <em> Deprecated <!-- --> since version <!-- --> 6.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Attempting to run the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.reIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.reIndex() </code> </span> </a> method writes a warning message to the log. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> mongosh Method </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page documents 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> method. This is <em> not </em> the documentation for database commands or language-specific drivers, such as Node.js. </p> <p class="leafygreen-ui-1kp3ins"> For the database command, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/reIndex/#mongodb-dbcommand-dbcmd.reIndex"> <code class="leafygreen-ui-1l06pbn"> reIndex </code> </a> command <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB API drivers, refer to the language-specific <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB driver documentation <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.reIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.reIndex() </code> </span> </a> drops all indexes on a collection and recreates them. This operation may be expensive for collections that have a large amount of data and/or a large number of indexes. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.reIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.reIndex() </code> </span> </a> may only be run on <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-standalone"> standalone </a> instances. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For most users, the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.reIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.reIndex() </code> </span> </a> command is unnecessary. </p> </li> </ul> </div> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This method is available in deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> <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 command is not supported in MongoDB Atlas clusters. For information on Atlas support for all commands, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> For MongoDB 5.0 or later, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.reIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.reIndex() </code> </span> </a> may only be run on <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-standalone"> standalone </a> instances. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Resource Locking <a class="headerlink leafygreen-ui-1kepx47" href="#resource-locking" 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="resource-locking"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.reIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.reIndex() </code> </span> </a> obtains an exclusive (W) lock on the collection and blocks other operations on the collection until it completes. </p> <p class="leafygreen-ui-1kp3ins"> For more information on locking in MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/faq/concurrency/"> FAQ: Concurrency <!-- --> . </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/indexes/"> Indexes </a> </p> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/data-modeling/design-patterns/data-versioning/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Document and Schema Versioning <a class="headerlink leafygreen-ui-1kepx47" href="#document-and-schema-versioning" 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="document-and-schema-versioning"> </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="#use-cases" target="_self"> <span> Use Cases </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#tasks" target="_self"> <span> Tasks </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> <p class="leafygreen-ui-1kp3ins"> Your schema may need to change over time to account for changing technical requirements. When your schema changes, you can use schema design patterns to retain your original document structure. By retaining historical versions of documents and schemas, you avoid performance-intensive schema migrations and downtime. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Use Cases <a class="headerlink leafygreen-ui-1kepx47" href="#use-cases" 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-cases"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Use versioning patterns when your data requirements change and you want to keep historical data in its original form. Versioning patterns are most useful when your application meets any of these conditions: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Application downtime is not an option for migration. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Updating documents to the new schema may take hours, days, or weeks to complete. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Updating documents to the new schema is not a requirement. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Versioning patterns help you decide how data migrations take place and provide more flexibility relative to tabular databases. </p> <p class="leafygreen-ui-1kp3ins"> Consider these specific application use cases for versioning patterns: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> An insurance company lets customers modify their policy to insure additional items. When a customer changes their policy, the insurance company keeps a record of the policy changes over time. The company uses the <strong> Document Versioning </strong> pattern to track policy revisions by storing each update in a separate document. Historical data is stored in a separate collection, and does not impact queries on current data. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A company stores customer contact information. In the original schema, various contact methods like <code class="leafygreen-ui-1l06pbn"> homePhone </code> , <code class="leafygreen-ui-1l06pbn"> cellPhone </code> , and <code class="leafygreen-ui-1l06pbn"> email </code> are stored in individual fields. Over time, fewer customers have <code class="leafygreen-ui-1l06pbn"> homePhone </code> numbers, so the company modifies the schema to move contact information to a generic <code class="leafygreen-ui-1l06pbn"> contacts </code> document, which has variable subfields. After the schema change, the company implements the <strong> Schema Versioning </strong> pattern, and adds a <code class="leafygreen-ui-1l06pbn"> schemaVersion </code> field to tell the application how it should query each document. </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Tasks <a class="headerlink leafygreen-ui-1kepx47" href="#tasks" 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="tasks"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To learn how to keep a history of document and schema changes, see these pages: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/design-patterns/data-versioning/document-versioning/#std-label-design-patterns-document-versioning"> Keep a History of Document Versions </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/design-patterns/data-versioning/schema-versioning/#std-label-design-patterns-schema-versioning"> Maintain Different Schema Versions </a> </p> </li> </ul> </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> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/schema-design-process/#std-label-data-modeling-schema-design"> Schema Design Process </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/design-patterns/#std-label-schema-design-patterns"> Schema Design Patterns </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/data-consistency/#std-label-data-modeling-data-consistency"> Data Consistency </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/top/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $top (aggregation accumulator) <a class="headerlink leafygreen-ui-1kepx47" href="#-top--aggregation-accumulator-" 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="-top--aggregation-accumulator-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#restrictions" target="_self"> <span> Restrictions </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="group"> <dt> <code class="leafygreen-ui-1l06pbn"> $top </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-group-grp.-top" 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-group-grp.-top"> </div> </a> </dt> <dd> <div> <p> <em> New <!-- --> in version <!-- --> 5.2 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Returns the top element within a group according to the specified sort order. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n $top:\n {\n sortBy: { &lt;field1&gt;: &lt;sort&gt;, &lt;field2&gt;: &lt;sort&gt; ... },\n output: &lt;expression&gt;\n }\n}"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> $top:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> sortBy: { &lt;field1&gt;: &lt;sort order&gt;, &lt;field2&gt;: &lt;sort order&gt; ... },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> output: &lt;expression&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:15%"/> <col style="width:15%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Necessity </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> sortBy </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Required </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the order of results, with syntax similar to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sort/#mongodb-pipeline-pipe.-sort"> <code class="leafygreen-ui-1l06pbn"> $sort </code> . </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> output </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Required </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Represents the output for each element in the group and can be any expression. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Null and Missing Values <a class="headerlink leafygreen-ui-1kepx47" href="#null-and-missing-values" 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="null-and-missing-values"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Consider the following aggregation that returns the top document from a group of scores: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $top </code> does not filter out null values. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $top </code> converts missing values to null. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.aggregate( [\n {\n $documents: [\n { playerId: \"PlayerA\", gameId: \"G1\", score: 1 },\n { playerId: \"PlayerB\", gameId: \"G1\", score: 2 },\n { playerId: \"PlayerC\", gameId: \"G1\", score: 3 },\n { playerId: \"PlayerD\", gameId: \"G1\"},\n { playerId: \"PlayerE\", gameId: \"G1\", score: null }\n ]\n },\n {\n $group:\n {\n _id: \"$gameId\",\n playerId:\n {\n $top:\n {\n output: [ \"$playerId\", \"$score\" ],\n sortBy: { \"score\": 1 }\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$documents</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">playerId</span>: <span class="lg-highlight-string">"PlayerA"</span>, <span class="lg-highlight-attr">gameId</span>: <span class="lg-highlight-string">"G1"</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">playerId</span>: <span class="lg-highlight-string">"PlayerB"</span>, <span class="lg-highlight-attr">gameId</span>: <span class="lg-highlight-string">"G1"</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">2</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">playerId</span>: <span class="lg-highlight-string">"PlayerC"</span>, <span class="lg-highlight-attr">gameId</span>: <span class="lg-highlight-string">"G1"</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">3</span> }<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">playerId</span>: <span class="lg-highlight-string">"PlayerD"</span>, <span class="lg-highlight-attr">gameId</span>: <span class="lg-highlight-string">"G1"</span>}<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">playerId</span>: <span class="lg-highlight-string">"PlayerE"</span>, <span class="lg-highlight-attr">gameId</span>: <span class="lg-highlight-string">"G1"</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-literal">null</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$group</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"$gameId"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">playerId</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$top</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->[ <span class="lg-highlight-string">"$playerId"</span>, <span class="lg-highlight-string">"$score"</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-string">"score"</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In this example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/documents/#mongodb-pipeline-pipe.-documents"> <code class="leafygreen-ui-1l06pbn"> $documents </code> </a> creates the literal documents that contain player scores. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> groups the documents by <code class="leafygreen-ui-1l06pbn"> gameId </code> . This example has only one <code class="leafygreen-ui-1l06pbn"> gameId </code> , <code class="leafygreen-ui-1l06pbn"> G1 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> PlayerD </code> has a missing score and <code class="leafygreen-ui-1l06pbn"> PlayerE </code> has a null <code class="leafygreen-ui-1l06pbn"> score </code> . These values are both considered as null. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> playerId </code> and <code class="leafygreen-ui-1l06pbn"> score </code> fields are specified as <code class="leafygreen-ui-1l06pbn"> output : ["$playerId"," $score"] </code> and returned as array values. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Specify the sort order with <code class="leafygreen-ui-1l06pbn"> sortBy: { "score": 1 } </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> PlayerD </code> and <code class="leafygreen-ui-1l06pbn"> PlayerE </code> tied for the top element. <code class="leafygreen-ui-1l06pbn"> PlayerD </code> is returned as the top <code class="leafygreen-ui-1l06pbn"> score </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To have more deterministic tie breaking behavior for multiple null values, add more fields to <code class="leafygreen-ui-1l06pbn"> sortBy </code> . </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n {\n _id: 'G1',\n playerId: [ 'PlayerD', null ]\n }\n]","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">'G1'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">playerId</span>: <!-- -->[ <span class="lg-highlight-string">'PlayerD'</span>, <span class="lg-highlight-literal">null</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Restrictions <a class="headerlink leafygreen-ui-1kepx47" href="#restrictions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="restrictions"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Window Function and Aggregation Expression Support <a class="headerlink leafygreen-ui-1kepx47" href="#window-function-and-aggregation-expression-support" 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="window-function-and-aggregation-expression-support"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $top </code> is not supported as a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> aggregation expression <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $top </code> is supported as a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> window operator </code> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Memory Limit Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#memory-limit-considerations" 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="memory-limit-considerations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Aggregation pipelines which call <code class="leafygreen-ui-1l06pbn"> $top </code> are subject to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/aggregation-pipeline-limits/#std-label-agg-memory-restrictions"> 100 MB limit </a> . If this limit is exceeded for an individual group, the aggregation fails with an error. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Consider a <code class="leafygreen-ui-1l06pbn"> gamescores </code> collection with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.gamescores.insertMany([\n { playerId: \"PlayerA\", gameId: \"G1\", score: 31 },\n { playerId: \"PlayerB\", gameId: \"G1\", score: 33 },\n { playerId: \"PlayerC\", gameId: \"G1\", score: 99 },\n { playerId: \"PlayerD\", gameId: \"G1\", score: 1 },\n { playerId: \"PlayerA\", gameId: \"G2\", score: 10 },\n { playerId: \"PlayerB\", gameId: \"G2\", score: 14 },\n { playerId: \"PlayerC\", gameId: \"G2\", score: 66 },\n { playerId: \"PlayerD\", gameId: \"G2\", score: 80 }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">gamescores</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">playerId</span>: <span class="lg-highlight-string">"PlayerA"</span>, <span class="lg-highlight-attr">gameId</span>: <span class="lg-highlight-string">"G1"</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">31</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">playerId</span>: <span class="lg-highlight-string">"PlayerB"</span>, <span class="lg-highlight-attr">gameId</span>: <span class="lg-highlight-string">"G1"</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">33</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">playerId</span>: <span class="lg-highlight-string">"PlayerC"</span>, <span class="lg-highlight-attr">gameId</span>: <span class="lg-highlight-string">"G1"</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">99</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">playerId</span>: <span class="lg-highlight-string">"PlayerD"</span>, <span class="lg-highlight-attr">gameId</span>: <span class="lg-highlight-string">"G1"</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">playerId</span>: <span class="lg-highlight-string">"PlayerA"</span>, <span class="lg-highlight-attr">gameId</span>: <span class="lg-highlight-string">"G2"</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">10</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">playerId</span>: <span class="lg-highlight-string">"PlayerB"</span>, <span class="lg-highlight-attr">gameId</span>: <span class="lg-highlight-string">"G2"</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">14</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">playerId</span>: <span class="lg-highlight-string">"PlayerC"</span>, <span class="lg-highlight-attr">gameId</span>: <span class="lg-highlight-string">"G2"</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">66</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">playerId</span>: <span class="lg-highlight-string">"PlayerD"</span>, <span class="lg-highlight-attr">gameId</span>: <span class="lg-highlight-string">"G2"</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">80</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Find the Top <code class="leafygreen-ui-1l06pbn"> Score </code> <a class="headerlink leafygreen-ui-1kepx47" href="#find-the-top-score" 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="find-the-top-score"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can use the <code class="leafygreen-ui-1l06pbn"> $top </code> accumulator to find the top score in a single game. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.gamescores.aggregate( [\n {\n $match : { gameId : \"G1\" }\n },\n {\n $group:\n {\n _id: \"$gameId\",\n playerId:\n {\n $top:\n {\n output: [ \"$playerId\", \"$score\" ],\n sortBy: { \"score\": -1 }\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">gamescores</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->$match<!-- --> <!-- -->: <!-- -->{ <!-- -->gameId <!-- -->: <span class="lg-highlight-string">"G1"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$group</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"$gameId"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">playerId</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$top</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->[ <span class="lg-highlight-string">"$playerId"</span>, <span class="lg-highlight-string">"$score"</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-string">"score"</span>: <!-- -->-<span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The example pipeline: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/match/#mongodb-pipeline-pipe.-match"> <code class="leafygreen-ui-1l06pbn"> $match </code> </a> to filter the results on a single <code class="leafygreen-ui-1l06pbn"> gameId </code> . In this case, <code class="leafygreen-ui-1l06pbn"> G1 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> to group the results by <code class="leafygreen-ui-1l06pbn"> gameId </code> . In this case, <code class="leafygreen-ui-1l06pbn"> G1 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Specifies the fields that are output for <code class="leafygreen-ui-1l06pbn"> $top </code> with <code class="leafygreen-ui-1l06pbn"> output : ["$playerId"," $score"] </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses <code class="leafygreen-ui-1l06pbn"> sortBy: { "score": -1 } </code> to sort the scores in descending order. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses <code class="leafygreen-ui-1l06pbn"> $top </code> to return the top score in the game. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[ { _id: 'G1', playerId: [ 'PlayerC', 99 ] } ]","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">'G1'</span>, <span class="lg-highlight-attr">playerId</span>: <!-- -->[ <span class="lg-highlight-string">'PlayerC'</span>, <span class="lg-highlight-number">99</span> ] } ]</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Find the Top <code class="leafygreen-ui-1l06pbn"> Score </code> Across Multiple Games <a class="headerlink leafygreen-ui-1kepx47" href="#find-the-top-score-across-multiple-games" 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="find-the-top-score-across-multiple-games"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can use the <code class="leafygreen-ui-1l06pbn"> $top </code> accumulator to find the top <code class="leafygreen-ui-1l06pbn"> score </code> in each game. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.gamescores.aggregate( [\n {\n $group:\n { _id: \"$gameId\", playerId:\n {\n $top:\n {\n output: [ \"$playerId\", \"$score\" ],\n sortBy: { \"score\": -1 }\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">gamescores</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$group</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"$gameId"</span>, <span class="lg-highlight-attr">playerId</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$top</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->[ <span class="lg-highlight-string">"$playerId"</span>, <span class="lg-highlight-string">"$score"</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-string">"score"</span>: <!-- -->-<span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The example pipeline: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses <code class="leafygreen-ui-1l06pbn"> $group </code> to group the results by <code class="leafygreen-ui-1l06pbn"> gameId </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses <code class="leafygreen-ui-1l06pbn"> $top </code> to return top <code class="leafygreen-ui-1l06pbn"> score </code> for each game. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Specifies the fields that are output for <code class="leafygreen-ui-1l06pbn"> $top </code> with <code class="leafygreen-ui-1l06pbn"> output : ["$playerId", "$score"] </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses <code class="leafygreen-ui-1l06pbn"> sortBy: { "score": -1 } </code> to sort the scores in descending order. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n { _id: 'G2', playerId: [ 'PlayerD', 80 ] },\n { _id: 'G1', playerId: [ 'PlayerC', 99 ] }\n]","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">'G2'</span>, <span class="lg-highlight-attr">playerId</span>: <!-- -->[ <span class="lg-highlight-string">'PlayerD'</span>, <span class="lg-highlight-number">80</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">'G1'</span>, <span class="lg-highlight-attr">playerId</span>: <!-- -->[ <span class="lg-highlight-string">'PlayerC'</span>, <span class="lg-highlight-number">99</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/range/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $range (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-range--aggregation-" 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="-range--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $range </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-range" 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-expression-exp.-range"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns an array whose elements are a generated sequence of numbers. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-range" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $range </code> </span> </a> generates the sequence from the specified starting number by successively incrementing the starting number by the specified step value up to but not including the end point. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-range" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $range </code> </span> </a> has the following <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-agg-quick-ref-operator-expressions"> operator expression syntax <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $range: [ &lt;start&gt;, &lt;end&gt;, &lt;non-zero&gt; ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$range</span>: <!-- -->[ &lt;<!-- -->start<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->end<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-tag lg-highlight-xml">&lt;</span><span class="lg-highlight-name lg-highlight-tag lg-highlight-xml">non-zero</span><span class="lg-highlight-tag lg-highlight-xml"> </span><span class="lg-highlight-attr lg-highlight-tag lg-highlight-xml">step</span><span class="lg-highlight-tag lg-highlight-xml">&gt;</span><span class="lg-highlight-xml"> ] }</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-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:40%"/> <col style="width:60%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Operand </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> &lt;start&gt; </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An integer that specifies the start of the sequence. Can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to an integer. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> &lt;end&gt; </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An integer that specifies the exclusive upper limit of the sequence. Can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to an integer. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> &lt;non-zero step&gt; </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. An integer that specifies the increment value. Can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a non-zero integer. Defaults to 1. </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> &lt;start&gt; </code> and <code class="leafygreen-ui-1l06pbn"> &lt;end&gt; </code> arguments are required and must be integers. The <code class="leafygreen-ui-1l06pbn"> &lt;non-zero step&gt; </code> argument is optional, and defaults to <code class="leafygreen-ui-1l06pbn"> 1 </code> if omitted. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:70%"/> <col style="width:30%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Results </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $range: [ 0, 10, 2 ] } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> [ 0, 2, 4, 6, 8 ] </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $range: [ 10, 0, -2 ] } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> [ 10, 8, 6, 4, 2 ] </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $range: [ 0, 10, -2 ] } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> [ ] </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $range: [ 0, 5 ] } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> [ 0, 1, 2, 3, 4 ] </code> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example uses a collection called <code class="leafygreen-ui-1l06pbn"> distances </code> that lists cities along with their distance in miles from San Francisco. </p> <p class="leafygreen-ui-1kp3ins"> Documents in the <code class="leafygreen-ui-1l06pbn"> distances </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.distances.insertMany([\n { _id: 0, city: \"San Jose\", distance: 42 },\n { _id: 1, city: \"Sacramento\", distance: 88 },\n { _id: 2, city: \"Reno\", distance: 218 },\n { _id: 3, city: \"Los Angeles\", distance: 383 }\n]);","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">distances</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-string">"San Jose"</span>, <span class="lg-highlight-attr">distance</span>: <span class="lg-highlight-number">42</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-string">"Sacramento"</span>, <span class="lg-highlight-attr">distance</span>: <span class="lg-highlight-number">88</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-string">"Reno"</span>, <span class="lg-highlight-attr">distance</span>: <span class="lg-highlight-number">218</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-string">"Los Angeles"</span>, <span class="lg-highlight-attr">distance</span>: <span class="lg-highlight-number">383</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> A bicyclist is planning to ride from San Francisco to each city listed in the collection and wants to stop and rest every 25 miles. The following aggregation pipeline operation uses the <code class="leafygreen-ui-1l06pbn"> $range </code> operator to determine the stopping points for each trip. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.distances.aggregate([{\n $project: {\n _id: 0,\n city: 1,\n \"Rest stops\": { $range: [ 0, \"$distance\", 25 ] }\n }\n}])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">distances</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(<!-- -->[<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"Rest stops"</span>: <!-- -->{ <span class="lg-highlight-attr">$range</span>: <!-- -->[ <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"$distance"</span>, <span class="lg-highlight-number">25</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"city\" : \"San Jose\", \"Rest stops\" : [ 0, 25 ] }\n{ \"city\" : \"Sacramento\", \"Rest stops\" : [ 0, 25, 50, 75 ] }\n{ \"city\" : \"Reno\", \"Rest stops\" : [ 0, 25, 50, 75, 100, 125, 150, 175, 200 ] }\n{ \"city\" : \"Los Angeles\", \"Rest stops\" : [ 0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375 ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"city"</span> <!-- -->: <span class="lg-highlight-string">"San Jose"</span>, <span class="lg-highlight-string">"Rest stops"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">0</span>, <span class="lg-highlight-number">25</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"city"</span> <!-- -->: <span class="lg-highlight-string">"Sacramento"</span>, <span class="lg-highlight-string">"Rest stops"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">0</span>, <span class="lg-highlight-number">25</span>, <span class="lg-highlight-number">50</span>, <span class="lg-highlight-number">75</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"city"</span> <!-- -->: <span class="lg-highlight-string">"Reno"</span>, <span class="lg-highlight-string">"Rest stops"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">0</span>, <span class="lg-highlight-number">25</span>, <span class="lg-highlight-number">50</span>, <span class="lg-highlight-number">75</span>, <span class="lg-highlight-number">100</span>, <span class="lg-highlight-number">125</span>, <span class="lg-highlight-number">150</span>, <span class="lg-highlight-number">175</span>, <span class="lg-highlight-number">200</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"city"</span> <!-- -->: <span class="lg-highlight-string">"Los Angeles"</span>, <span class="lg-highlight-string">"Rest stops"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">0</span>, <span class="lg-highlight-number">25</span>, <span class="lg-highlight-number">50</span>, <span class="lg-highlight-number">75</span>, <span class="lg-highlight-number">100</span>, <span class="lg-highlight-number">125</span>, <span class="lg-highlight-number">150</span>, <span class="lg-highlight-number">175</span>, <span class="lg-highlight-number">200</span>, <span class="lg-highlight-number">225</span>, <span class="lg-highlight-number">250</span>, <span class="lg-highlight-number">275</span>, <span class="lg-highlight-number">300</span>, <span class="lg-highlight-number">325</span>, <span class="lg-highlight-number">350</span>, <span class="lg-highlight-number">375</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> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDate/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $toDate (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-todate--aggregation-" 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="-todate--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $toDate </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-toDate" 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-expression-exp.-toDate"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Converts a value to a date. If the value cannot be converted to a date, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-toDate" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $toDate </code> </span> </a> errors. If the value is null or missing, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-toDate" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $toDate </code> </span> </a> returns null. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-toDate" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $toDate </code> </span> </a> has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n $toDate: &lt;expression&gt;\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$toDate</span>: &lt;<!-- -->expression<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-toDate" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $toDate </code> </span> </a> takes any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-toDate" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $toDate </code> </span> </a> is a shorthand for the following <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/convert/#mongodb-expression-exp.-convert"> <code class="leafygreen-ui-1l06pbn"> $convert </code> </a> expression: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $convert: { input: &lt;expression&gt;, to: \"date\" } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$convert</span>: <!-- -->{ <span class="lg-highlight-attr">input</span>: &lt;<!-- -->expression<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-attr">to</span>: <span class="lg-highlight-string">"date"</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-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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/convert/#mongodb-expression-exp.-convert"> <code class="leafygreen-ui-1l06pbn"> $convert </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/dateFromString/#mongodb-expression-exp.-dateFromString"> <code class="leafygreen-ui-1l06pbn"> $dateFromString </code> </a> </p> </li> </ul> </div> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following table lists the input types that can be converted to a date: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Input Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Behavior </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Double </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Returns a date that corresponds to the number of milliseconds represented by the truncated double value. </p> <p class="leafygreen-ui-1kp3ins"> Positive number corresponds to the number of milliseconds since Jan 1, 1970. </p> <p class="leafygreen-ui-1kp3ins"> Negative number corresponds to the number of milliseconds before Jan 1, 1970. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Decimal </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Returns a date that corresponds to the number of milliseconds represented by the truncated decimal value. </p> <p class="leafygreen-ui-1kp3ins"> Positive number corresponds to the number of milliseconds since Jan 1, 1970. </p> <p class="leafygreen-ui-1kp3ins"> Negative number corresponds to the number of milliseconds before Jan 1, 1970. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Long </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Returns a date that corresponds to the number of milliseconds represented by the long value. </p> <p class="leafygreen-ui-1kp3ins"> Positive number corresponds to the number of milliseconds since Jan 1, 1970. </p> <p class="leafygreen-ui-1kp3ins"> Negative number corresponds to the number of milliseconds before Jan 1, 1970. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> String </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Returns a date that corresponds to the date string. </p> <p class="leafygreen-ui-1kp3ins"> The string must be a valid date string, such as: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> "2018-03-20" </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> "2018-03-20T12:00:00Z" </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> "2018-03-20T12:00:00+0500" </p> </li> </ul> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ObjectId </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a date that corresponds to the timestamp of the ObjectId. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Timestamp </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a date that corresponds to the timestamp. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> The following table lists some conversion to date examples: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:80%"/> <col style="width:20%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Results </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDate: 120000000000.5} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ISODate("1973-10-20T21:20:00Z") </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDate: NumberDecimal("1253372036000.50")} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ISODate("2009-09-19T14:53:56Z") </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDate: NumberLong("1100000000000")} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ISODate("2004-11-19T11:33:20Z") </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDate: NumberLong("-1100000000000")} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ISODate("1935-02-22T12:26:40Z") </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDate: ObjectId("5ab9c3da31c2ab715d421285")} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ISODate("2018-03-27T04:08:58Z") </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDate: "2018-03-20"} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ISODate("2018-03-20T00:00:00Z") </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDate: "2018-03-20 11:00:06 +0500"} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ISODate("2018-03-20T06:00:06Z") </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDate: "Friday"} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Error </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {$toDate: Timestamp({ t: 1637688118, i: 1 })} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ISODate("2021-11-23T17:21:58.00Z") </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Create a collection <code class="leafygreen-ui-1l06pbn"> orders </code> with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.orders.insertMany( [\n { _id: 1, item: \"apple\", qty: 5, price: 2, order_date: new Date( \"2018-03-20\" ) },\n { _id: 2, item: \"pie\", qty: 10, price: 3, order_date: new Date( \"2018-03-22\" ) },\n { _id: 3, item: \"ice cream\", qty: 2, price: 4, order_date: \"2018-03-15\" },\n { _id: 4, item: \"almonds\" , qty: 5, price: 7, order_date: \"2018-03-15 +10:00\" }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">orders</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"apple"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">order_date</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>( <span class="lg-highlight-string">"2018-03-20"</span> ) }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"pie"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">order_date</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>( <span class="lg-highlight-string">"2018-03-22"</span> ) }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"ice cream"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">order_date</span>: <span class="lg-highlight-string">"2018-03-15"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"almonds"</span> <!-- -->, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">7</span>, <span class="lg-highlight-attr">order_date</span>: <span class="lg-highlight-string">"2018-03-15 +10:00"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following aggregation operation on the <code class="leafygreen-ui-1l06pbn"> orders </code> collection converts the <code class="leafygreen-ui-1l06pbn"> order_date </code> to date before sorting by the date value: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"// Define stage to add convertedDate field with the converted order_date value\n\ndateConversionStage = {\n $addFields: {\n convertedDate: { $toDate: \"$order_date\" }\n }\n};\n\n// Define stage to sort documents by the converted date\n\nsortStage = {\n $sort: { \"convertedDate\": 1 }\n};\n\ndb.orders.aggregate( [\n dateConversionStage,\n sortStage\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">//</span><span class="lg-highlight-comment"> Define stage to </span><span class="lg-highlight-comment">add convertedDate</span><span class="lg-highlight-comment"> field with the </span><span class="lg-highlight-comment">converted order_date value</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">dateConversionStage <!-- -->= <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$addFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">convertedDate</span>: <!-- -->{ <span class="lg-highlight-attr">$toDate</span>: <span class="lg-highlight-string">"$order_date"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">//</span><span class="lg-highlight-comment"> Define stage to </span><span class="lg-highlight-comment">sort documents by the converted date</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">sortStage <!-- -->= <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$sort</span>: <!-- -->{ <span class="lg-highlight-string">"convertedDate"</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">orders</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->dateConversionStage<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->sortStage</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: 4,\n item: 'almonds',\n qty: 5,\n price: 7,\n order_date: '2018-03-15 +10:00',\n convertedDate: ISODate(\"2018-03-14T14:00:00.000Z\")\n},\n{\n _id: 3,\n item: 'ice cream',\n qty: 2,\n price: 4,\n order_date: '2018-03-15',\n convertedDate: ISODate(\"2018-03-15T00:00:00.000Z\")\n},\n{\n _id: 1,\n item: 'apple',\n qty: 5,\n price: 2,\n order_date: ISODate(\"2018-03-20T00:00:00.000Z\"),\n convertedDate: ISODate(\"2018-03-20T00:00:00.000Z\")\n},\n{\n _id: 2,\n item: 'pie',\n qty: 10,\n price: 3,\n order_date: ISODate(\"2018-03-22T00:00:00.000Z\"),\n convertedDate: ISODate(\"2018-03-22T00:00:00.000Z\")\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'almonds'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">5</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">7</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">order_date</span>: <span class="lg-highlight-string">'2018-03-15 +10:00'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">convertedDate</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2018-03-14T14:00:00.000Z"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'ice cream'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">4</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">order_date</span>: <span class="lg-highlight-string">'2018-03-15'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">convertedDate</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2018-03-15T00:00:00.000Z"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'apple'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">5</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">order_date</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2018-03-20T00:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">convertedDate</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2018-03-20T00:00:00.000Z"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'pie'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">10</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">3</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">order_date</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2018-03-22T00:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">convertedDate</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2018-03-22T00:00:00.000Z"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If the conversion operation encounters an error, the aggregation operation stops and throws an error. To override this behavior, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/convert/#mongodb-expression-exp.-convert"> <code class="leafygreen-ui-1l06pbn"> $convert </code> </a> instead. </p> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/multiply/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $multiply (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-multiply--aggregation-" 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="-multiply--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $multiply </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-multiply" 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-expression-exp.-multiply"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Multiplies numbers together and returns the result. Pass the arguments to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-multiply" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $multiply </code> </span> </a> in an array. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-multiply" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $multiply </code> </span> </a> expression has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $multiply: [ &lt;expression1&gt;, &lt;expression2&gt;, ... ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$multiply</span>: <!-- -->[ &lt;<!-- -->expression1<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->expression2<!-- -->&gt;<!-- -->,<!-- --> <!-- -->...<!-- --> ] }</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 arguments can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> as long as they resolve to numbers. For more information on expressions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> Expression Operators <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 6.1 you can optimize the <code class="leafygreen-ui-1l06pbn"> $multiply </code> operation. To improve performance, group references at the end of the argument list. For example, </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$multiply: [ 1, 2, 3, '$a', '$b', '$c' ]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">$multiply</span>: <!-- -->[ <span class="lg-highlight-number">1</span>, <span class="lg-highlight-number">2</span>, <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">'$a'</span>, <span class="lg-highlight-string">'$b'</span>, <span class="lg-highlight-string">'$c'</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> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> When input types are mixed, <code class="leafygreen-ui-1l06pbn"> $multiply </code> promotes the smaller input type to the larger of the two. A type is considered larger when it represents a wider range of values. The order of numeric types from smallest to largest is: integer → long → double → decimal </p> <p class="leafygreen-ui-1kp3ins"> The larger of the input types also determines the result type unless the operation overflows and is beyond the range represented by that larger data type. In cases of overflow, <code class="leafygreen-ui-1l06pbn"> $multiply </code> promotes the result according to the following order: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the larger input type is <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Int32"> <code class="leafygreen-ui-1l06pbn"> integer </code> </a> , the result type is promoted to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Int64"> <code class="leafygreen-ui-1l06pbn"> long </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the larger input type is <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Int64"> <code class="leafygreen-ui-1l06pbn"> long </code> </a> , the result type is promoted to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Double"> <code class="leafygreen-ui-1l06pbn"> double </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the larger type is <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Double"> <code class="leafygreen-ui-1l06pbn"> double </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Decimal128"> <code class="leafygreen-ui-1l06pbn"> decimal </code> </a> , the overflow result is represented as + or - infinity. There is no type promotion of the result. </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Consider a <code class="leafygreen-ui-1l06pbn"> sales </code> collection with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"item\" : \"abc\", \"price\" : 10, \"quantity\": 2, date: ISODate(\"2014-03-01T08:00:00Z\") }\n{ \"_id\" : 2, \"item\" : \"jkl\", \"price\" : 20, \"quantity\": 1, date: ISODate(\"2014-03-01T09:00:00Z\") }\n{ \"_id\" : 3, \"item\" : \"xyz\", \"price\" : 5, \"quantity\": 10, date: ISODate(\"2014-03-15T09:00:00Z\") }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"quantity"</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-03-01T08:00:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"jkl"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">20</span>, <span class="lg-highlight-string">"quantity"</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-03-01T09:00:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"quantity"</span>: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-03-15T09:00:00Z"</span>) }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following aggregation uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-multiply" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $multiply </code> </span> </a> expression in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/project/#mongodb-pipeline-pipe.-project"> <code class="leafygreen-ui-1l06pbn"> $project </code> </a> pipeline to multiply the <code class="leafygreen-ui-1l06pbn"> price </code> and the <code class="leafygreen-ui-1l06pbn"> quantity </code> fields: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.sales.aggregate(\n [\n { $project: { date: 1, item: 1, total: { $multiply: [ \"$price\", \"$quantity\" ] } } }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">sales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$project</span>: <!-- -->{ <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">total</span>: <!-- -->{ <span class="lg-highlight-attr">$multiply</span>: <!-- -->[ <span class="lg-highlight-string">"$price"</span>, <span class="lg-highlight-string">"$quantity"</span> ] } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"item\" : \"abc\", \"date\" : ISODate(\"2014-03-01T08:00:00Z\"), \"total\" : 20 }\n{ \"_id\" : 2, \"item\" : \"jkl\", \"date\" : ISODate(\"2014-03-01T09:00:00Z\"), \"total\" : 20 }\n{ \"_id\" : 3, \"item\" : \"xyz\", \"date\" : ISODate(\"2014-03-15T09:00:00Z\"), \"total\" : 50 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-03-01T08:00:00Z"</span>)<!-- -->, <span class="lg-highlight-string">"total"</span> <!-- -->: <span class="lg-highlight-number">20</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"jkl"</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-03-01T09:00:00Z"</span>)<!-- -->, <span class="lg-highlight-string">"total"</span> <!-- -->: <span class="lg-highlight-number">20</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz"</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-03-15T09:00:00Z"</span>)<!-- -->, <span class="lg-highlight-string">"total"</span> <!-- -->: <span class="lg-highlight-number">50</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> </section> </section>
https://www.mongodb.com/docs/manual/data-modeling/schema-design-process/create-indexes/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Create Indexes to Support Your Queries <a class="headerlink leafygreen-ui-1kepx47" href="#create-indexes-to-support-your-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="create-indexes-to-support-your-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="#about-this-task" target="_self"> <span> About this Task </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#steps" target="_self"> <span> Steps </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </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> <p class="leafygreen-ui-1kp3ins"> An index covers a query when the index contains all of the fields scanned by the query. A covered query scans the index and not the collection, which improves query performance. </p> <p class="leafygreen-ui-1kp3ins"> Indexes can also partially support queries if a subset of the fields queried are indexed. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> About this Task <a class="headerlink leafygreen-ui-1kepx47" href="#about-this-task" 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="about-this-task"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A single collection can have a maximum of 64 indexes. However, too many indexes can degrade performance before that limit is reached. For collections with a high write-to-read ratio, indexes can degrade performance because each insert must also update any indexes. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Steps <a class="headerlink leafygreen-ui-1kepx47" href="#steps" 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="steps"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"To identify common query patterns in your application, use the\n$queryStats aggregation stage. $queryStats reports\nmetrics for query shapes, which group\nqueries based on shared fields.","name":"Identify common queries"},{"@type":"HowToStep","text":"After you know which fields your application frequently queries,\nyou can create indexes to support queries on those fields. For\nmore information, see Examples.","name":"Create indexes to support common queries"},{"@type":"HowToStep","text":"After your application begins using indexes, you can analyze your\nindexes' effectiveness. To see index statistics and usage, you\ncan:Use the $indexStats aggregation stage.For MongoDB Atlas deployments, view Indexes in the\nAtlas UI.Consider deleting unused indexes to improve application\nperformance. For more information, see\nRemove Unnecessary Indexes.","name":"Analyze index use"}],"name":"Steps","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Identify common queries <a class="headerlink leafygreen-ui-1kepx47" href="#identify-common-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="identify-common-queries"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To identify common query patterns in your application, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/queryStats/#mongodb-pipeline-pipe.-queryStats"> <code class="leafygreen-ui-1l06pbn"> $queryStats </code> </a> aggregation stage. <code class="leafygreen-ui-1l06pbn"> $queryStats </code> reports metrics for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-query-shape"> query shapes </a> , which group queries based on shared fields. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create indexes to support common queries <a class="headerlink leafygreen-ui-1kepx47" href="#create-indexes-to-support-common-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="create-indexes-to-support-common-queries"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> After you know which fields your application frequently queries, you can create indexes to support queries on those fields. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-schema-design-indexes-examples" target="_self"> <span> Examples <!-- --> . </span> </a> </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Analyze index use <a class="headerlink leafygreen-ui-1kepx47" href="#analyze-index-use" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="analyze-index-use"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> After your application begins using indexes, you can analyze your indexes' effectiveness. To see index statistics and usage, you can: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/indexStats/#mongodb-pipeline-pipe.-indexStats"> <code class="leafygreen-ui-1l06pbn"> $indexStats </code> </a> aggregation stage. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For MongoDB Atlas deployments, view <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-ui/indexes/#std-label-atlas-ui-view-indexes" target="_self"> <span> Indexes </span> </a> in the Atlas UI. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Consider deleting unused indexes to improve application performance. For more information, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/design-antipatterns/unnecessary-indexes/#std-label-unnecessary-indexes-antipattern"> Remove Unnecessary Indexes <!-- --> . </a> </p> </section> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Repeat this procedure periodically to ensure that your indexes support your current workload. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-schema-design-indexes-examples"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create a Single-Key Index <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-single-key-index" 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-single-key-index"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If your application only queries on a single key in a given collection, then you need to create a single-key index for that collection. For example, you can create an index on <code class="leafygreen-ui-1l06pbn"> category </code> in the <code class="leafygreen-ui-1l06pbn"> product </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products.createIndex( { category: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-number">1</span> } )</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 preceding index supports this query: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products.find( { category: \"electronics\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"electronics"</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> <span class="leafygreen-ui-1qnjd6d" id="std-label-compound-key-indexes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create a Compound Index <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-compound-index" 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-compound-index"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If your application performs queries on both a single key and multiple keys, a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-compound/#std-label-index-type-compound"> compound index </a> is more efficient than a single-key index. For example, you can create an index on the <code class="leafygreen-ui-1l06pbn"> category </code> , <code class="leafygreen-ui-1l06pbn"> item </code> , and <code class="leafygreen-ui-1l06pbn"> location </code> fields: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products.createIndex( { category: 1, item: 1, location: 1 } )","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">products</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">location</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Index Prefixes <a class="headerlink leafygreen-ui-1kepx47" href="#index-prefixes" 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="index-prefixes"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> A compound index supports queries on index prefixes, which are the beginning subsets of indexed fields. For example, the preceding index supports these queries: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products.find( { category: \"electronics\" } )\ndb.products.find( { category: \"electronics\", item: \"television\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"electronics"</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"electronics"</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"television"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information and performance considerations on index prefixes, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-compound/#std-label-compound-index-prefix"> Index Prefixes <!-- --> . </a> </p> </section> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create Indexes to Support Text Search <a class="headerlink leafygreen-ui-1kepx47" href="#create-indexes-to-support-text-search" 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-indexes-to-support-text-search"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> For data hosted on MongoDB Atlas, you can support full-text search with Atlas Search indexes. To learn more, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/create-index/" target="_self"> <span> Create an Atlas Search Index <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> For self-managed (non-Atlas) deployments, MongoDB provides a <code class="leafygreen-ui-1l06pbn"> text </code> index type that supports searching for string content in a collection. To learn more about self-managed text indexes, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-feature-text"> Text Indexes on Self-Managed Deployments <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create Vector Search Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#create-vector-search-indexes" 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-vector-search-indexes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Vector Search Indexes support queries on vector embeddings. To create Vector Search Indexes, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/" target="_self"> <span> Index Fields for Vector Search <!-- --> . </span> </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Index Use and Collation <a class="headerlink leafygreen-ui-1kepx47" href="#index-use-and-collation" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="index-use-and-collation"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To use an index for string comparisons, an operation must also specify the same collation. That is, an index with a collation cannot support an operation that performs string comparisons on the indexed fields if the operation specifies a different collation. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Because indexes that are configured with collation use ICU collation keys to achieve sort order, collation-aware index keys may be larger than index keys for indexes without collation. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For example, the collection <code class="leafygreen-ui-1l06pbn"> myColl </code> has an index on a string field <code class="leafygreen-ui-1l06pbn"> category </code> with the collation locale <code class="leafygreen-ui-1l06pbn"> "fr" </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.createIndex( { category: 1 }, { collation: { locale: \"fr\" } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-number">1</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following query operation, which specifies the same collation as the index, can use the index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { category: \"cafe\" } ).collation( { locale: \"fr\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> } ).<span class="lg-highlight-title lg-highlight-function">collation</span>( <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> However, the following query operation, which by default uses the "simple" binary collator, cannot use the index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { category: \"cafe\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For a compound index where the index prefix keys are not strings, arrays, and embedded documents, an operation that specifies a different collation can still use the index to support comparisons on the index prefix keys. </p> <p class="leafygreen-ui-1kp3ins"> For example, the collection <code class="leafygreen-ui-1l06pbn"> myColl </code> has a compound index on the numeric fields <code class="leafygreen-ui-1l06pbn"> score </code> and <code class="leafygreen-ui-1l06pbn"> price </code> and the string field <code class="leafygreen-ui-1l06pbn"> category </code> ; the index is created with the collation locale <code class="leafygreen-ui-1l06pbn"> "fr" </code> for string comparisons: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.createIndex(\n { score: 1, price: 1, category: 1 },\n { collation: { locale: \"fr\" } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operations, which use <code class="leafygreen-ui-1l06pbn"> "simple" </code> binary collation for string comparisons, can use the index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { score: 5 } ).sort( { price: 1 } )\ndb.myColl.find( { score: 5, price: { $gt: NumberDecimal( \"10\" ) } } ).sort( { price: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">5</span> } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">price</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>( <span class="lg-highlight-string">"10"</span> ) } } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation, which uses <code class="leafygreen-ui-1l06pbn"> "simple" </code> binary collation for string comparisons on the indexed <code class="leafygreen-ui-1l06pbn"> category </code> field, can use the index to fulfill only the <code class="leafygreen-ui-1l06pbn"> score: 5 </code> portion of the query: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { score: 5, category: \"cafe\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Matches against document keys, including embedded document keys, use simple binary comparison. This means that a query for a key like "foo.bár" will not match the key "foo.bar", regardless of the value you set for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation-parameter-strength"> strength </a> parameter. </p> </div> </div> </section> </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> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/equality-sort-range-rule/#std-label-esr-indexing-rule"> The ESR (Equality, Sort, Range) Rule </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> Collation </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-optimization/#std-label-read-operations-indexing"> Query Optimization </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/BinData/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> BinData() <a class="headerlink leafygreen-ui-1kepx47" href="#bindata--" 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="bindata--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Creates a binary data object. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> BinData </code> has the following syntax: </p> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> BinData(&lt;sub_type&gt;,&lt;buffer&gt;) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-BinData" 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-method-BinData"> </div> </a> </dt> <dd> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:60%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> sub_type </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-binData-subtype" target="_self"> <span> binary subtype </span> </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> buffer </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The buffer object containing binary data. Must be a base 64 encoded string value. </div> </div> </td> </tr> </tbody> </table> </div> <table class="css-11h39yh e1nex8bq0"> <colgroup> <col class="field-name"/> <col class="field-body"/> </colgroup> <tbody> <tr class="css-x8snli"> <th> Returns <!-- --> : </th> <td> A binary data object. </td> </tr> </tbody> </table> </dd> </dl> <span class="leafygreen-ui-1qnjd6d" id="std-label-binData-subtype"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Binary Subtypes <a class="headerlink leafygreen-ui-1kepx47" href="#binary-subtypes" 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-subtypes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Specify one of the following values for <code class="leafygreen-ui-1l06pbn"> sub_type </code> : </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:10%"/> <col style="width:30%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Number </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 0 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Generic binary subtype </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 1 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Function data </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 2 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Binary (old) </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 3 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UUID (old) </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 4 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UUID </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MD5 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 6 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Encrypted BSON value </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 7 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Compressed time series data </p> <div> <p> <em> New <!-- --> in version <!-- --> 5.2 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 8 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Sensitive data, such as a key or secret. MongoDB does not log literal values for binary data with subtype 8. Instead, MongoDB logs a placeholder value of <code class="leafygreen-ui-1l06pbn"> ### </code> . </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 9 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Vector data, which is densely packed arrays of numbers of the same type. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 128 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Custom data </div> </div> </td> </tr> </tbody> </table> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-endianness"> endianness </a> of your system depends on the architecture of your machine. Numbers in BSON data are always stored as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-little-endian"> little-endian </a> , if your system is <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-big-endian"> big-endian </a> this means that numeric data is converted between big and little endian. </p> <p class="leafygreen-ui-1kp3ins"> In the context of the bit-test match expression operators: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/bitsAnySet/#mongodb-query-op.-bitsAnySet"> <code class="leafygreen-ui-1l06pbn"> $bitsAnySet </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/bitsAnyClear/#mongodb-query-op.-bitsAnyClear"> <code class="leafygreen-ui-1l06pbn"> $bitsAnyClear </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/bitsAllSet/#mongodb-query-op.-bitsAllSet"> <code class="leafygreen-ui-1l06pbn"> $bitsAllSet </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/bitsAllClear/#mongodb-query-op.-bitsAllClear"> <code class="leafygreen-ui-1l06pbn"> $bitsAllClear </code> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Binary"> <code class="leafygreen-ui-1l06pbn"> BinData </code> </a> values act as <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/Mask_(computing)" rel="noopener noreferrer"> <span> bitmasks </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> and are interpreted as though they are arbitrary-length unsigned little-endian numbers. The lowest-addressable byte is always interpreted as the least significant byte. Similarly, the highest-addressable byte in the <code class="leafygreen-ui-1l06pbn"> BinData </code> is always interpreted as the most significant byte. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Insert a <code class="leafygreen-ui-1l06pbn"> BinData() </code> Object <a class="headerlink leafygreen-ui-1kepx47" href="#insert-a-bindata---object" 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="insert-a-bindata---object"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use the <code class="leafygreen-ui-1l06pbn"> BinData() </code> constructor to create the <code class="leafygreen-ui-1l06pbn"> bdata </code> variable. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var bdata = BinData(0, \"gf1UcxdHTJ2HQ/EGQrO7mQ==\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> bdata <!-- -->= <span class="lg-highlight-title lg-highlight-class">BinData</span>(<span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"gf1UcxdHTJ2HQ/EGQrO7mQ=="</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"> Insert the object into the <code class="leafygreen-ui-1l06pbn"> testbin </code> collection. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.testbin.insertOne( { _id : 1, bin_data: bdata } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">testbin</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>( <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">bin_data</span>: <!-- -->bdata } )</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"> Query the <code class="leafygreen-ui-1l06pbn"> testbin </code> collection for the inserted document. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.testbin.find()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">testbin</span>.<span class="lg-highlight-title lg-highlight-function">find</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"> You can see the binary <code class="leafygreen-ui-1l06pbn"> buffer </code> stored in the collection. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: 1,\n bin_data: Binary(Buffer.from(\"81fd547317474c9d8743f10642b3bb99\", \"hex\"), 0)\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bin_data</span>: <span class="lg-highlight-title lg-highlight-class">Binary</span>(<span class="lg-highlight-title lg-highlight-class">Buffer</span>.<span class="lg-highlight-title lg-highlight-function">from</span>(<span class="lg-highlight-string">"81fd547317474c9d8743f10642b3bb99"</span>, <span class="lg-highlight-string">"hex"</span>)<!-- -->, <span class="lg-highlight-number">0</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Get the Length of <code class="leafygreen-ui-1l06pbn"> BinData() </code> Object <a class="headerlink leafygreen-ui-1kepx47" href="#get-the-length-of-bindata---object" 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="get-the-length-of-bindata---object"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use the <code class="leafygreen-ui-1l06pbn"> BinData() </code> constructor to create the <code class="leafygreen-ui-1l06pbn"> bdata </code> variable. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var bdata = BinData(0, \"gf1UcxdHTJ2HQ/EGQrO7mQ==\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> bdata <!-- -->= <span class="lg-highlight-title lg-highlight-class">BinData</span>(<span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"gf1UcxdHTJ2HQ/EGQrO7mQ=="</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"> Use <code class="leafygreen-ui-1l06pbn"> .length() </code> to return the bit length of the object. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"bdata.length()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">bdata.<span class="lg-highlight-title lg-highlight-function">length</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 returned value is: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"16","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-number">16</span></td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/release-notes/5.0/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Release Notes for MongoDB 5.0 <a class="headerlink leafygreen-ui-1kepx47" href="#release-notes-for-mongodb-5.0" 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="release-notes-for-mongodb-5.0"> </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="#patch-releases" target="_self"> <span> Patch Releases </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#time-series-collections" target="_self"> <span> Time Series Collections </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#aggregation" target="_self"> <span> Aggregation </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#auditing" target="_self"> <span> Auditing </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#capped-collections" target="_self"> <span> Capped Collections </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#change-streams" target="_self"> <span> Change Streams </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#indexes" target="_self"> <span> Indexes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#removed-commands" target="_self"> <span> Removed Commands </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#replica-sets" target="_self"> <span> Replica Sets </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#security" target="_self"> <span> Security </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#sharded-clusters" target="_self"> <span> Sharded Clusters </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#shell-changes" target="_self"> <span> Shell Changes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#snapshots" target="_self"> <span> Snapshots </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#transactions" target="_self"> <span> Transactions </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#naming-changes" target="_self"> <span> Naming Changes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#general-changes" target="_self"> <span> General Changes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#performance-considerations" target="_self"> <span> Performance Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#platform-support" target="_self"> <span> Platform Support </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#changes-affecting-compatibility" target="_self"> <span> Changes Affecting Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#upgrade-procedures" target="_self"> <span> Upgrade Procedures </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#downgrade-consideration" target="_self"> <span> Downgrade Consideration </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#download" target="_self"> <span> Download </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#known-issues" target="_self"> <span> Known Issues </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#report-an-issue" target="_self"> <span> Report an Issue </span> </a> </li> </ul> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 Released July 13, 2021 </p> </div> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Patch Releases <a class="headerlink leafygreen-ui-1kepx47" href="#patch-releases" 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="patch-releases"> </div> </a> </h2> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Past Release Limitations </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The Critical Advisories below affect some prior MongoDB versions. If your deployment depends on features impacted by a Critical Advisory, upgrade to the latest available patch release. </p> <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> Issue </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Affected Versions </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-7984" rel="noopener noreferrer"> <span> WT-7984 </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> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5.0.0 - 5.0.2 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-7995" rel="noopener noreferrer"> <span> WT-7995 </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> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5.0.0 - 5.0.2 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-10461" rel="noopener noreferrer"> <span> WT-10461 </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> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5.0.0 - 5.0.14 (ARM64 or POWER system architectures) </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-10551" rel="noopener noreferrer"> <span> WT-10551 </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> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5.0.2 - 5.0.17 (Incremental backups on Ops Manager or Cloud Manager clusters) </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-58936" rel="noopener noreferrer"> <span> SERVER-58936 </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> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5.0.0 - 5.0.1 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-60176" rel="noopener noreferrer"> <span> SERVER-60176 </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> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5.0.0 - 5.0.21 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-68511" rel="noopener noreferrer"> <span> SERVER-68511 </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> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5.0.0 - 5.0.10 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-77506" rel="noopener noreferrer"> <span> SERVER-77506 </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> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5.0.0 - 5.0.23 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-80203" rel="noopener noreferrer"> <span> SERVER-80203 </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> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5.0.6 - 5.0.21 (Time Series collections sharded by metaField embedded objects) </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-82353" rel="noopener noreferrer"> <span> SERVER-82353 </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> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5.0.0 - 5.0.24 </div> </div> </td> </tr> </tbody> </table> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.29-release-notes"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.29 - Sep 30, 2024 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.29---sep-30--2024" 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="5.0.29---sep-30--2024"> </div> </a> </h3> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Fix for CSFLE and Queryable Encryption self-lookup may send values in subpipelines as plaintext instead of ciphertext </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Due to CVE-2024-8013, in <!-- --> MongoDB 5.0 prior to 5.0.28 <!-- --> , a bug in query analysis of certain complex self-referential <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/lookup/#mongodb-pipeline-pipe.-lookup"> <code class="leafygreen-ui-1l06pbn"> $lookup </code> </a> subpipelines may result in literal values in expressions for encrypted fields being sent to the server malformed. </p> <p class="leafygreen-ui-1kp3ins"> Should this occur, no documents are returned or written. This issue affects the <code class="leafygreen-ui-1l06pbn"> mongocryptd </code> binary and <code class="leafygreen-ui-1l06pbn"> mongo_crypt_v1 </code> shared library in the following MongoDB Server versions: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 7.3.0 - 7.3.3 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 7.0.0 - 7.0.11 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 6.0.0 - 6.0.16 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 5.0.0 - 5.0.28 </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <strong> CVSS Score </strong> : 2.2 </p> <p class="leafygreen-ui-1kp3ins"> <strong> CWE </strong> : CWE-319: Cleartext Transmission of Sensitive Information </p> </div> </div> <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://jira.mongodb.org/browse/SERVER-96254" rel="noopener noreferrer"> <span> SERVER-96254 </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> CSFLE and Queryable Encryption self-lookup may fail to encrypt values in subpipelines </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-59831" rel="noopener noreferrer"> <span> SERVER-59831 </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> WTUniqueIndex::_insert expects secondaries to pass in dupsAllowed=true </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-76777" rel="noopener noreferrer"> <span> SERVER-76777 </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> Deadlock between index build external abort and self abort </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-88750" rel="noopener noreferrer"> <span> SERVER-88750 </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> Add "bypassEmptyTsReplacement" param to insert, update, findAndModify, and bulkWrite </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-91223" rel="noopener noreferrer"> <span> SERVER-91223 </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> $log gives incorrect calculation with Decimal128 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-8771" rel="noopener noreferrer"> <span> WT-8771 </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> Checkpoint cleanup to dirty obsolete page with overflow items </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.29" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.29 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.29-changelog"> 5.0.29 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.28-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.28 - Jul 15, 2024 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.28---jul-15--2024" 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="5.0.28---jul-15--2024"> </div> </a> </h3> <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://jira.mongodb.org/browse/SERVER-63198" rel="noopener noreferrer"> <span> SERVER-63198 </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> Prevent shutdown command from hanging </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-90747" rel="noopener noreferrer"> <span> SERVER-90747 </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> Handle $elemMatch with empty path in plan enumerator correctly </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-91362" rel="noopener noreferrer"> <span> SERVER-91362 </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> Performance: Do not copy JS "scope" object if a cached JsExecution exists </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-91562" rel="noopener noreferrer"> <span> SERVER-91562 </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> [5.0] IndexDescriptor::compareIndexOptions treats no unique/sparse as not identical to unique:false/sparse:false </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-10807" rel="noopener noreferrer"> <span> WT-10807 </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> Skip in-memory deleted pages as part of the tree walk </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.28" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.28 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.28-changelog"> 5.0.28 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.27-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.27 - Jun 04, 2024 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.27---jun-04--2024" 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="5.0.27---jun-04--2024"> </div> </a> </h3> <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://jira.mongodb.org/browse/SERVER-78556" rel="noopener noreferrer"> <span> SERVER-78556 </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> Return default of internalInsertMaxBatchSize to 64 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-79637" rel="noopener noreferrer"> <span> SERVER-79637 </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> Incorrect query results in $lookup with TS foreign collection using a correlated predicate </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-80363" rel="noopener noreferrer"> <span> SERVER-80363 </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> server default writeConcern is not honored when wtimeout is set </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-86474" rel="noopener noreferrer"> <span> SERVER-86474 </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> $_internalApplyOplogUpdate with $set: { foo: Timestamp(0, 0) } is not replicated correctly </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-86648" rel="noopener noreferrer"> <span> SERVER-86648 </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> Resumable index build sorter files are not fsynced on shutdown </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.27" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.27 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.27-changelog"> 5.0.27 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.26-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.26 - Mar 26, 2024 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.26---mar-26--2024" 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="5.0.26---mar-26--2024"> </div> </a> </h3> <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://jira.mongodb.org/browse/SERVER-68128" rel="noopener noreferrer"> <span> SERVER-68128 </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> Exceptions thrown while generating command response lead to network error </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-72703" rel="noopener noreferrer"> <span> SERVER-72703 </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> Downgrade $out's db lock to MODE_IX </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-83602" rel="noopener noreferrer"> <span> SERVER-83602 </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> $or -&gt; $in MatchExpression rewrite should not generate $or directly nested in another $or </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-86717" rel="noopener noreferrer"> <span> SERVER-86717 </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> Resharding should validate user provided zone range doesn't include $-prefixed fields. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-11062" rel="noopener noreferrer"> <span> WT-11062 </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> Safe free the ref addr to allow concurrent access </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.26" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.26 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.26-changelog"> 5.0.26 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.25-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.25 - Feb 28, 2024 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.25---feb-28--2024" 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="5.0.25---feb-28--2024"> </div> </a> </h3> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Fix for MongoDB Server may allow successful untrusted connection </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Due to CVE-2024-1351, in <!-- --> MongoDB 5.0 prior to 5.0.25 <!-- --> , under certain configurations of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsCAFile"> <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.CAFile"> <code class="leafygreen-ui-1l06pbn"> CAFile </code> </a> , MongoDB Server may skip peer certificate validation which may result in untrusted connections to succeed. </p> <p class="leafygreen-ui-1kp3ins"> This may effectively reduce the security guarantees provided by TLS and open connections that should have been closed due to failing certificate validation. This issue affects the following MongoDB Server versions: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 7.0.0 - 7.0.5 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 6.0.0 - 6.0.13 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 5.0.0 - 5.0.24 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 4.4.0 - 4.4.28 </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <strong> CVSS Score </strong> : 8.8 </p> <p class="leafygreen-ui-1kp3ins"> <strong> CWE </strong> : CWE-295: Improper Certificate Validation </p> </div> </div> <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://jira.mongodb.org/browse/SERVER-64444" rel="noopener noreferrer"> <span> SERVER-64444 </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> listIndexes fails on invalid pre-5.0 index spec after upgrade </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-82353" rel="noopener noreferrer"> <span> SERVER-82353 </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> Multi-document transactions can miss documents when movePrimary runs concurrently </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-83564" rel="noopener noreferrer"> <span> SERVER-83564 </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> Make sure the process field is indexed in config.locks </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-85419" rel="noopener noreferrer"> <span> SERVER-85419 </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> Balancer pollutes logs in case no suitable recipient is found during draining </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-10017" rel="noopener noreferrer"> <span> WT-10017 </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> Remove the unstable historical versions at the end of rollback to stable </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.25" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.25 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.25-changelog"> 5.0.25 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.24-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.24 - Jan 18, 2024 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.24---jan-18--2024" 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="5.0.24---jan-18--2024"> </div> </a> </h3> <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://jira.mongodb.org/browse/SERVER-50792" rel="noopener noreferrer"> <span> SERVER-50792 </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> Return more useful errors when a shard key index can't be found for shardCollection/refineCollectionShardKey </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-77506" rel="noopener noreferrer"> <span> SERVER-77506 </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> Sharded multi-document transactions can mismatch data and ShardVersion </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-81878" rel="noopener noreferrer"> <span> SERVER-81878 </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> startupRecoveryForRestore may not play nicely with collection drop applied during startup recovery </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-83091" rel="noopener noreferrer"> <span> SERVER-83091 </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> $or query can trigger an infinite loop during plan enumeration </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-7929" rel="noopener noreferrer"> <span> WT-7929 </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> Investigate a solution to avoid FTDC stalls during checkpoint </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.24" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.24 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.24-changelog"> 5.0.24 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.23-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.23 - Nov 27, 2023 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.23---nov-27--2023" 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="5.0.23---nov-27--2023"> </div> </a> </h3> <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://jira.mongodb.org/browse/SERVER-78108" rel="noopener noreferrer"> <span> SERVER-78108 </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> POS interface should expose its shutdown state </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-78115" rel="noopener noreferrer"> <span> SERVER-78115 </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> Shard primaries must commit a majority write before using new routing information from the config server </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-83150" rel="noopener noreferrer"> <span> SERVER-83150 </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> Document::shred() does not copy document metadata </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-11564" rel="noopener noreferrer"> <span> WT-11564 </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> Fix RTS to read the newest transaction value only when it exists in the checkpoint </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-11602" rel="noopener noreferrer"> <span> WT-11602 </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> Hide expected eviction failures from the application and don't rollback in case of errors </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.23" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.23 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.23-changelog"> 5.0.23 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.22-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.22 - Oct 26, 2023 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.22---oct-26--2023" 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="5.0.22---oct-26--2023"> </div> </a> </h3> <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://jira.mongodb.org/browse/SERVER-68548" rel="noopener noreferrer"> <span> SERVER-68548 </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> MongoDB Shell version 4.4.15 logging asio message despite --quiet flag </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-80021" rel="noopener noreferrer"> <span> SERVER-80021 </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> Make $convert round-trip correctly between double and string </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-80703" rel="noopener noreferrer"> <span> SERVER-80703 </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> Avoid traversing routing table in MigrationDestinationManager </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-81106" rel="noopener noreferrer"> <span> SERVER-81106 </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> Recipient shard doesn't wait for the collection version to be locally persisted before starting the cloning phase </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-11064" rel="noopener noreferrer"> <span> WT-11064 </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> Skip globally visible tombstones as part of update obsolete check </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.22" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.22 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.22-changelog"> 5.0.22 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.21-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.21 - Sep 12, 2023 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.21---sep-12--2023" 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="5.0.21---sep-12--2023"> </div> </a> </h3> <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://jira.mongodb.org/browse/SERVER-60466" rel="noopener noreferrer"> <span> SERVER-60466 </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> Support drivers gossiping signed $clusterTimes to replica set --shardsvrs before addShard is run </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-71627" rel="noopener noreferrer"> <span> SERVER-71627 </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> Refreshed cached collection route info will severely block all client request when a cluster with 1 million chunks </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-78813" rel="noopener noreferrer"> <span> SERVER-78813 </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> Commit point propagation fails indefinitely with exhaust cursors with null lastCommitted optime </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-10759" rel="noopener noreferrer"> <span> WT-10759 </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> Do not retry to force evict history store pages during reconciliation </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-11051" rel="noopener noreferrer"> <span> WT-11051 </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> Fix newest start durable timestamp comparison in aggregate timestamp validation </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.21" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.21 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.21-changelog"> 5.0.21 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.20-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.20 - Aug 14, 2023 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.20---aug-14--2023" 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="5.0.20---aug-14--2023"> </div> </a> </h3> <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://jira.mongodb.org/browse/SERVER-74954" rel="noopener noreferrer"> <span> SERVER-74954 </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> Incorrect result when contained $or rewrites $elemMatch extra condition </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-78813" rel="noopener noreferrer"> <span> SERVER-78813 </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> Commit point propagation fails indefinitely with exhaust cursors with null lastCommitted optime </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-79136" rel="noopener noreferrer"> <span> SERVER-79136 </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> Incorrect query result of $match + $group on metaField over time-series </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-10449" rel="noopener noreferrer"> <span> WT-10449 </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> Do not save update chain when there are no updates to be written to the history store </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-11031" rel="noopener noreferrer"> <span> WT-11031 </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> Fix RTS to skip tables with no time window information in the checkpoint </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.20" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.20 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.20-changelog"> 5.0.20 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.19-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.19 - Jul 13, 2023 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.19---jul-13--2023" 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="5.0.19---jul-13--2023"> </div> </a> </h3> <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://jira.mongodb.org/browse/SERVER-71985" rel="noopener noreferrer"> <span> SERVER-71985 </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> Automatically retry time series insert on DuplicateKey error </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-74551" rel="noopener noreferrer"> <span> SERVER-74551 </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> WriteConflictException unnecessarily logged as warning during findAndModify after upgrade to mongo 5.0 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-77018" rel="noopener noreferrer"> <span> SERVER-77018 </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> Deadlock between dbStats and 2 index builds </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-78126" rel="noopener noreferrer"> <span> SERVER-78126 </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> For specific kinds of input, mongo::Value() always hashes to the same result on big-endian platforms </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-10253" rel="noopener noreferrer"> <span> WT-10253 </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> Run session dhandle sweep and session cursor sweep more often </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.19" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.19 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.19-changelog"> 5.0.19 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.18-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.18 - May 18, 2023 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.18---may-18--2023" 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="5.0.18---may-18--2023"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-48196" rel="noopener noreferrer"> <span> SERVER-48196 </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> Upgrade the timelib to the latest to update the built-in timezone files to the latest </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-54150" rel="noopener noreferrer"> <span> SERVER-54150 </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> Recovery from a stable checkpoint should fassert on oplog application failures </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-57056" rel="noopener noreferrer"> <span> SERVER-57056 </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> Syslog severity set incorrectly for INFO messages </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-72686" rel="noopener noreferrer"> <span> SERVER-72686 </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> Add support for $collStats agg stage on timeseries collection </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-10551" rel="noopener noreferrer"> <span> WT-10551 </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> Incremental backup may omit modified blocks </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.18" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.18 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.18-changelog"> 5.0.18 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.17-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.17 - Apr 27, 2023 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.17---apr-27--2023" 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="5.0.17---apr-27--2023"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-73229" rel="noopener noreferrer"> <span> SERVER-73229 </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> Logical sessions cache refresh ignores write errors from updating session document, leading to cursors being killed early </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-74647" rel="noopener noreferrer"> <span> SERVER-74647 </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> Resharding state machine creation should be retried after interruption </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-75261" rel="noopener noreferrer"> <span> SERVER-75261 </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> "listCollections" command fails with BSONObjectTooLarge error </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-75431" rel="noopener noreferrer"> <span> SERVER-75431 </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> Get rid or fix best effort check for primary db on rename path in sharded clusters </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-76098" rel="noopener noreferrer"> <span> SERVER-76098 </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> Allow queries with $search and non-simple collations </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.17" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.17 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.17-changelog"> 5.0.17 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.16-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.16 - Apr 10, 2023 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.16---apr-10--2023" 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="5.0.16---apr-10--2023"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-61909" rel="noopener noreferrer"> <span> SERVER-61909 </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> Hang inserting or deleting document with large number of index entries </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-73822" rel="noopener noreferrer"> <span> SERVER-73822 </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> Time-series $group rewrite ignores certain accumulators </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-74345" rel="noopener noreferrer"> <span> SERVER-74345 </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> mongodb-org-server 4.4.19, 5.0.15, 6.0.5 not starting after upgrading from older version (Debian, RPM Packages) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-74501" rel="noopener noreferrer"> <span> SERVER-74501 </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> Fix MigrationBatchFetcher/Inserter completion reliance to not spawn an extra cleanup thread </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-75205" rel="noopener noreferrer"> <span> SERVER-75205 </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> Deadlock between stepdown and restoring locks after yielding when all read tickets exhausted </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.16" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.16 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.16-changelog"> 5.0.16 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.15-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.15 - Feb 27, 2023 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.15---feb-27--2023" 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="5.0.15---feb-27--2023"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-54900" rel="noopener noreferrer"> <span> SERVER-54900 </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> Blocking networking calls can delay sync-source resolution indefinitely </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-72416" rel="noopener noreferrer"> <span> SERVER-72416 </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> The find and findAndModify projection code does not honor the collection level collation </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-71759" rel="noopener noreferrer"> <span> SERVER-71759 </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> dataSize command doesn't yield </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-72222" rel="noopener noreferrer"> <span> SERVER-72222 </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> MapReduce with single reduce optimization fails when merging results in sharded cluster </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-9268" rel="noopener noreferrer"> <span> WT-9268 </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> Delay deletion of the history store record to reconciliation </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.15" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.15 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.15-changelog"> 5.0.15 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.14-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.14 - Nov 21, 2022 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.14---nov-21--2022" 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="5.0.14---nov-21--2022"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-68477" rel="noopener noreferrer"> <span> SERVER-68477 </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> Improve NaN-handling for expireAfterSeconds TTL index parameter </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-66289" rel="noopener noreferrer"> <span> SERVER-66289 </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> $out incorrectly throws BSONObj size error on v5.0.8 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-61185" rel="noopener noreferrer"> <span> SERVER-61185 </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> Use prefix_search for unique index lookup </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-68115" rel="noopener noreferrer"> <span> SERVER-68115 </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> Bug fix for "elemMatchRootLength &gt; 0" invariant trigger </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-68139" rel="noopener noreferrer"> <span> SERVER-68139 </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> Resharding command fails if the projection sort is bigger than 100MB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.14" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.14 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.14-changelog"> 5.0.14 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.13-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.13 - Sep 29, 2022 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.13---sep-29--2022" 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="5.0.13---sep-29--2022"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-69611" rel="noopener noreferrer"> <span> SERVER-69611 </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> Set the -ffp-contract=off compiler option by default </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-69220" rel="noopener noreferrer"> <span> SERVER-69220 </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> refineCollectionShardKey permits toggling current shard key fields between range-based and hashed, leading to data inconsistency </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-67650" rel="noopener noreferrer"> <span> SERVER-67650 </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> Resharding recipient can return remainingOperationTimeEstimatedSecs=0 when the oplog applier hasn't caught up with the oplog fetcher </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-68094" rel="noopener noreferrer"> <span> SERVER-68094 </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> Resharding with custom generated _id fails with projection error </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-9870" rel="noopener noreferrer"> <span> WT-9870 </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> Fix updating pinned timestamp whenever oldest timestamp is updated during recovery </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.13" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.13 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.13-changelog"> 5.0.13 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.12-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.12 - Sep 05, 2022 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.12---sep-05--2022" 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="5.0.12---sep-05--2022"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-68925" rel="noopener noreferrer"> <span> SERVER-68925 </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> Reintroduce check table logging settings at startup (revert <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-43664" rel="noopener noreferrer"> <span> SERVER-43664 <!-- --> ) </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-63852" rel="noopener noreferrer"> <span> SERVER-63852 </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> getThreadName() should not crash </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-60958" rel="noopener noreferrer"> <span> SERVER-60958 </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> Avoid server hang in chunk migration when step-down event occurs </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-65382" rel="noopener noreferrer"> <span> SERVER-65382 </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> AutoSplitVector should not use clientReadable to reorder shard key fields </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-63843" rel="noopener noreferrer"> <span> SERVER-63843 </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> Don't allow recursive doLog in synchronous signal handlers </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.12" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.12 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.12-changelog"> 5.0.12 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.11-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.11 - Aug 19, 2022 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.11---aug-19--2022" 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="5.0.11---aug-19--2022"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-68511" rel="noopener noreferrer"> <span> SERVER-68511 </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> MovePrimary update of <code class="leafygreen-ui-1l06pbn"> config.databases </code> entry must use dotted fields notation </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-61321" rel="noopener noreferrer"> <span> SERVER-61321 </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> Improve handling of large/NaN values for text index version </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-60607" rel="noopener noreferrer"> <span> SERVER-60607 </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> Improve handling of large/NaN values for geo index version </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-68628" rel="noopener noreferrer"> <span> SERVER-68628 </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> Retrying a failed resharding operation after a primary failover can lead to server crash or lost writes </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-68522" rel="noopener noreferrer"> <span> SERVER-68522 </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> Prevent 5.0 binary from starting in fCV 4.4 with misconfigured TTL index </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-9500" rel="noopener noreferrer"> <span> WT-9500 </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> Fix RTS to use cell time window instead of key/value timestamps of HS update </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.11" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.11 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.11-changelog"> 5.0.11 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.10-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.10 - Jul 29, 2022 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.10---jul-29--2022" 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="5.0.10---jul-29--2022"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-66418" rel="noopener noreferrer"> <span> SERVER-66418 </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> Bad projection created during dependency analysis due to string order assumption </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-65821" rel="noopener noreferrer"> <span> SERVER-65821 </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> Deadlock during setFCV when there are prepared transactions that have not persisted commit/abort decision </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-65131" rel="noopener noreferrer"> <span> SERVER-65131 </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> Disable opportunistic read targeting (except for hedged reads) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-63971" rel="noopener noreferrer"> <span> SERVER-63971 </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> Change server parameter to default to read-your-writes behavior after 2PC transaction </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-66433" rel="noopener noreferrer"> <span> SERVER-66433 </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> Backport deadline waiting for overlapping range deletion to finish to pre-v5.1 versions </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.10" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.10 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.10-changelog"> 5.0.10 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.9-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.9 - May 31, 2022 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.9---may-31--2022" 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="5.0.9---may-31--2022"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-65636" rel="noopener noreferrer"> <span> SERVER-65636 </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> Remove limits on number of LDAP connections per host </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-65137" rel="noopener noreferrer"> <span> SERVER-65137 </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> Detect namespace changes when refreshing Collection after yielding </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-64822" rel="noopener noreferrer"> <span> SERVER-64822 </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> Sharding an empty collection releases the critical section too early </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-62175" rel="noopener noreferrer"> <span> SERVER-62175 </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> Mongos fails to attach RetryableWrite Error Label For Command Interrupted In _parseCommand </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-9096" rel="noopener noreferrer"> <span> WT-9096 </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> Fix search near returning wrong key/value sometimes when key doesn't exist </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.9" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.9 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.9-changelog"> 5.0.9 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.8-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.8 - Apr 25, 2022 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.8---apr-25--2022" 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="5.0.8---apr-25--2022"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-63531" rel="noopener noreferrer"> <span> SERVER-63531 </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> commitQuorum incorrectly includes buildIndexes:false nodes and error message incorrectly says that only voting nodes are eligible </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-63387" rel="noopener noreferrer"> <span> SERVER-63387 </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> 1 StreamingCursor should return backup blocks in the order they were retrieved from the WiredTiger backup cursor </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-62229" rel="noopener noreferrer"> <span> SERVER-62229 </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> Fix invariant when applying index build entries while recoverFromOplogAsStandalone=true </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-61879" rel="noopener noreferrer"> <span> SERVER-61879 </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> Refreshes to recover migrations must never join ongoing refreshes </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-8924" rel="noopener noreferrer"> <span> WT-8924 </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> Don't check against on disk time window if there is an insert list when checking for conflicts in row-store </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.8" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.8 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.8-changelog"> 5.0.8 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.7-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.7 - Apr 11, 2022 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.7---apr-11--2022" 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="5.0.7---apr-11--2022"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-64517" rel="noopener noreferrer"> <span> SERVER-64517 </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> RecoverableCriticalSection is not properly recovered on startup </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-64403" rel="noopener noreferrer"> <span> SERVER-64403 </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> Find queries with SORT_MERGE collation-encode the missing sort attribute </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-63742" rel="noopener noreferrer"> <span> SERVER-63742 </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> Default topology time in shard can lead to infinite refresh in shard registry </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-60412" rel="noopener noreferrer"> <span> SERVER-60412 </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> Host memory limit check does not honor cgroups v2 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-7922" rel="noopener noreferrer"> <span> WT-7922 </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> Handle missing WiredTiger version file </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.7" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.7 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.7-changelog"> 5.0.7 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.6-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.6 - Jan 31, 2022 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.6---jan-31--2022" 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="5.0.6---jan-31--2022"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/WT-8395" rel="noopener noreferrer"> <span> WT-8395 </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> Inconsistent data after upgrade from 4.4.3 and 4.4.4 to 4.4.8+ and 5.0.2+ </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-62245" rel="noopener noreferrer"> <span> SERVER-62245 </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> MigrationRecovery must not assume that only one migration needs to be recovered </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-61427" rel="noopener noreferrer"> <span> SERVER-61427 </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> Unique index builds can cause a loss of availability during commit due to checking many false duplicates </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-61194" rel="noopener noreferrer"> <span> SERVER-61194 </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> Prevent time-series bucket OID reuse with coarse granularity </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-60310" rel="noopener noreferrer"> <span> SERVER-60310 </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> OCSP response validation should not consider statuses of irrelevant certificates </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.6" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.6 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.6-changelog"> 5.0.6 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.5-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.5 - Dec 6, 2021 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.5---dec-6--2021" 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="5.0.5---dec-6--2021"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-61483" rel="noopener noreferrer"> <span> SERVER-61483 </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> Resharding coordinator fails to recover abort decision on step-up, attempts to commit operation as success, leading to data inconsistency </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-59858" rel="noopener noreferrer"> <span> SERVER-59858 </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> Add observability for tasks scheduled on the reactor thread </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-51329" rel="noopener noreferrer"> <span> SERVER-51329 </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> Unexpected non-retryable error when shutting down a mongos server </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-8163" rel="noopener noreferrer"> <span> WT-8163 </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> Consider more eviction scenarios to give up checkpoint-cleanup </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-7912" rel="noopener noreferrer"> <span> WT-7912 </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> Fix prefix search near optimisation to handle scenarios where the key range is split across pages. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.5" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.5 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.5-changelog"> 5.0.5 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.4-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.4 - Nov 15, 2021 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.4---nov-15--2021" 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="5.0.4---nov-15--2021"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-60326" rel="noopener noreferrer"> <span> SERVER-60326 </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> Windows Server fails to start when X509 certificate has empty subject name </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-59876" rel="noopener noreferrer"> <span> SERVER-59876 </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> Large delays in returning from libcrypto.so while establishing egress connections </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-59456" rel="noopener noreferrer"> <span> SERVER-59456 </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> Start the LDAPReaper threadpool </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-59226" rel="noopener noreferrer"> <span> SERVER-59226 </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> Deadlock when stepping down with a profile session marked as uninterruptible </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-59074" rel="noopener noreferrer"> <span> SERVER-59074 </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> Do not acquire storage tickets just to set/wait on oplog visibility </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2C%20TOOLS%2C%20WT)%20AND%20resolution%20%3D%20Fixed%20AND%20fixVersion%20%3D%205.0.4" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.4 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.4-changelog"> 5.0.4 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.3-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.3 - Sep 21, 2021 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.3---sep-21--2021" 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="5.0.3---sep-21--2021"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-57667" rel="noopener noreferrer"> <span> SERVER-57667 </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> : Improve processing speed for resharding's collection cloning pipeline </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-57630" rel="noopener noreferrer"> <span> SERVER-57630 </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> : Enable SSL_OP_NO_RENEGOTIATION on Ubuntu 18.04 when running against OpenSSL 1.1.1 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-8005" rel="noopener noreferrer"> <span> WT-8005 </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> : Fix a prepare commit bug that could leave the history store entry unresolved </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-7995" rel="noopener noreferrer"> <span> WT-7995 </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> : Fix the global visibility that it cannot go beyond checkpoint visibility </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-7984" rel="noopener noreferrer"> <span> WT-7984 </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> : Fix a bug that could cause a checkpoint to omit a page of data </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2CTOOLS%2CWT)%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%275.0.3%27" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.3 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.3-changelog"> 5.0.3 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.2-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.2 - Aug 4, 2021 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.2---aug-4--2021" 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="5.0.2---aug-4--2021"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-58936" rel="noopener noreferrer"> <span> SERVER-58936 </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> : Unique index constraints may not be enforced </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-57756" rel="noopener noreferrer"> <span> SERVER-57756 </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> : Race between concurrent stepdowns and applying transaction oplog entry </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-54729" rel="noopener noreferrer"> <span> SERVER-54729 </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> : MongoDB Enterprise Debian/Ubuntu packages should depend on libsasl2-modules and libsasl2-modules-gssapi-mit </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-47372" rel="noopener noreferrer"> <span> SERVER-47372 </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> : config.cache collections can remain even after collection has been dropped </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/WT-6729" rel="noopener noreferrer"> <span> WT-6729 </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> : Quiesce eviction prior running rollback to stable's active transaction check </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2CTOOLS%2CWT)%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%275.0.2%27" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.2 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.2-changelog"> 5.0.2 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.1-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.1 - Jul 22, 2021 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.1---jul-22--2021" 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="5.0.1---jul-22--2021"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Issues fixed: </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://jira.mongodb.org/browse/SERVER-58489" rel="noopener noreferrer"> <span> SERVER-58489 </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> : Collection creation stuck in an infinite writeConflictRetry loop when having a duplicate name as a view </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-58171" rel="noopener noreferrer"> <span> SERVER-58171 </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> : Changing time-series granularity does not update view definition </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/issues/?jql=project%20in%20(SERVER%2CTOOLS%2CWT)%20AND%20resolution%3D%27Fixed%27%20and%20fixversion%3D%275.0.1%27" rel="noopener noreferrer"> <span> All JIRA issues closed in 5.0.1 </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-changelog/#std-label-5.0.1-changelog"> 5.0.1 Changelog </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0.0-release-notes"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> 5.0.0 - Jul 13, 2021 <a class="headerlink leafygreen-ui-1kepx47" href="#5.0.0---jul-13--2021" 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="5.0.0---jul-13--2021"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The rest of this page provides the 5.0.0 release notes: </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Time Series Collections <a class="headerlink leafygreen-ui-1kepx47" href="#time-series-collections" 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="time-series-collections"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 introduces <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-manual-timeseries-collection"> time series collections </a> which efficiently store sequences of measurements over a period of time. Compared to normal collections, storing time series data in time series collections improves query efficiency and reduces disk usage for your data and indexes. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-agg"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Aggregation <a class="headerlink leafygreen-ui-1kepx47" href="#aggregation" 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="aggregation"> </div> </a> </h2> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-new-agg-operators"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> New Aggregation Operators <a class="headerlink leafygreen-ui-1kepx47" href="#new-aggregation-operators" 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="new-aggregation-operators"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 introduces the following aggregation operators: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Operator </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/count-accumulator/#mongodb-group-grp.-count"> <code class="leafygreen-ui-1l06pbn"> $count </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/count-accumulator/#mongodb-group-grp.-count"> <code class="leafygreen-ui-1l06pbn"> $count (aggregation accumulator) </code> </a> provides a count of all documents when used in the existing pipeline <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group (aggregation) </code> </a> stage and the new MongoDB 5.0 <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/count-accumulator/#mongodb-group-grp.-count"> <code class="leafygreen-ui-1l06pbn"> $count (aggregation accumulator) </code> </a> is distinct from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/count/#mongodb-pipeline-pipe.-count"> <code class="leafygreen-ui-1l06pbn"> $count (aggregation) </code> </a> pipeline stage. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/dateAdd/#mongodb-expression-exp.-dateAdd"> <code class="leafygreen-ui-1l06pbn"> $dateAdd </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Increments a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Date/#mongodb-method-Date"> <code class="leafygreen-ui-1l06pbn"> Date() </code> </a> object by a specified number of time units. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/dateDiff/#mongodb-expression-exp.-dateDiff"> <code class="leafygreen-ui-1l06pbn"> $dateDiff </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the difference between two dates. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/dateSubtract/#mongodb-expression-exp.-dateSubtract"> <code class="leafygreen-ui-1l06pbn"> $dateSubtract </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Decrements a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Date/#mongodb-method-Date"> <code class="leafygreen-ui-1l06pbn"> Date() </code> </a> object by a specified number of time units. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/dateTrunc/#mongodb-expression-exp.-dateTrunc"> <code class="leafygreen-ui-1l06pbn"> $dateTrunc </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Truncates a date. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/getField/#mongodb-expression-exp.-getField"> <code class="leafygreen-ui-1l06pbn"> $getField </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the value of a specified field from a document. You can use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/getField/#mongodb-expression-exp.-getField"> <code class="leafygreen-ui-1l06pbn"> $getField </code> </a> to retrieve the value of fields with names that contain periods ( <code class="leafygreen-ui-1l06pbn"> . </code> ) or start with dollar signs ( <code class="leafygreen-ui-1l06pbn"> $ </code> ). </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/rand/#mongodb-expression-exp.-rand"> <code class="leafygreen-ui-1l06pbn"> $rand </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/rand/#mongodb-expression-exp.-rand"> <code class="leafygreen-ui-1l06pbn"> $rand </code> </a> method generates a random float value between 0 and 1 each time it is called. The new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sampleRate/#mongodb-expression-exp.-sampleRate"> <code class="leafygreen-ui-1l06pbn"> $sampleRate </code> </a> operator is based on <code class="leafygreen-ui-1l06pbn"> $rand </code> . </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sampleRate/#mongodb-expression-exp.-sampleRate"> <code class="leafygreen-ui-1l06pbn"> $sampleRate </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sampleRate/#mongodb-expression-exp.-sampleRate"> <code class="leafygreen-ui-1l06pbn"> $sampleRate </code> </a> method to probabilistically select documents from a pipeline at a given rate. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setField/#mongodb-expression-exp.-setField"> <code class="leafygreen-ui-1l06pbn"> $setField </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds, updates, or removes a specified field in a document. You can use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setField/#mongodb-expression-exp.-setField"> <code class="leafygreen-ui-1l06pbn"> $setField </code> </a> to add, update, or remove fields with names that contain periods ( <code class="leafygreen-ui-1l06pbn"> . </code> ) or start with dollar signs ( <code class="leafygreen-ui-1l06pbn"> $ </code> ). </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/unsetField/#mongodb-expression-exp.-unsetField"> <code class="leafygreen-ui-1l06pbn"> $unsetField </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes a specified field in a document. An alias for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setField/#mongodb-expression-exp.-setField"> <code class="leafygreen-ui-1l06pbn"> $setField </code> </a> to remove fields with names that contain periods ( <code class="leafygreen-ui-1l06pbn"> . </code> ) or that start with dollar signs ( <code class="leafygreen-ui-1l06pbn"> $ </code> ). </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Window Operators <a class="headerlink leafygreen-ui-1kepx47" href="#window-operators" 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="window-operators"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 introduces the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> pipeline stage, allowing you to perform operations on a specified span of documents in a collection, known as a <em> window </em> . The operation returns the results based on the chosen <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-window-operators"> window operator <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> For example, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage to output the: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Difference in sales between two documents in a collection. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Sales rankings. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Cumulative sales totals. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Analysis of complex time series information without exporting the data to an external database. </p> </li> </ul> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> General Aggregation Improvements <a class="headerlink leafygreen-ui-1kepx47" href="#general-aggregation-improvements" 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="general-aggregation-improvements"> </div> </a> </h3> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> <code class="leafygreen-ui-1l06pbn"> $expr </code> Operator: Comparison Operators Use Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#-expr-operator--comparison-operators-use-indexes" 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="-expr-operator--comparison-operators-use-indexes"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/eq/#mongodb-expression-exp.-eq"> <code class="leafygreen-ui-1l06pbn"> $eq </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/lt/#mongodb-expression-exp.-lt"> <code class="leafygreen-ui-1l06pbn"> $lt </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/lte/#mongodb-expression-exp.-lte"> <code class="leafygreen-ui-1l06pbn"> $lte </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/gt/#mongodb-expression-exp.-gt"> <code class="leafygreen-ui-1l06pbn"> $gt </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/gte/#mongodb-expression-exp.-gte"> <code class="leafygreen-ui-1l06pbn"> $gte </code> </a> operators placed in an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/expr/#mongodb-query-op.-expr"> <code class="leafygreen-ui-1l06pbn"> $expr </code> </a> operator can use indexes to improve performance. </p> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> <code class="leafygreen-ui-1l06pbn"> $ifNull </code> Expression Accepts Multiple Input Expressions <a class="headerlink leafygreen-ui-1kepx47" href="#-ifnull-expression-accepts-multiple-input-expressions" 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="-ifnull-expression-accepts-multiple-input-expressions"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, you can specify multiple input expressions for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/ifNull/#mongodb-expression-exp.-ifNull"> <code class="leafygreen-ui-1l06pbn"> $ifNull </code> </a> expression before returning a replacement expression. </p> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> <code class="leafygreen-ui-1l06pbn"> let </code> Option for Aggregation <a class="headerlink leafygreen-ui-1kepx47" href="#let-option-for-aggregation" 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="let-option-for-aggregation"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/aggregate/#mongodb-dbcommand-dbcmd.aggregate"> <code class="leafygreen-ui-1l06pbn"> aggregate </code> </a> command and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.aggregate/#mongodb-method-db.collection.aggregate"> <code class="leafygreen-ui-1l06pbn"> db.collection.aggregate() </code> </a> helper method have a <code class="leafygreen-ui-1l06pbn"> let </code> option to specify a list of variables that can be used elsewhere in the aggregation pipeline. This allows you to improve command readability by separating the variables from the query text. </p> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> <code class="leafygreen-ui-1l06pbn"> $lookup </code> Stage: Concise Correlated Subqueries <a class="headerlink leafygreen-ui-1kepx47" href="#-lookup-stage--concise-correlated-subqueries" 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="-lookup-stage--concise-correlated-subqueries"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, an aggregation pipeline <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/lookup/#mongodb-pipeline-pipe.-lookup"> <code class="leafygreen-ui-1l06pbn"> $lookup </code> </a> stage supports <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/lookup/#std-label-lookup-syntax-concise-correlated-subquery"> concise correlated subqueries </a> that improve joins between collections. </p> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> <code class="leafygreen-ui-1l06pbn"> $lookup </code> Stage: Uncorrelated Subqueries <a class="headerlink leafygreen-ui-1kepx47" href="#-lookup-stage--uncorrelated-subqueries" 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="-lookup-stage--uncorrelated-subqueries"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, for an uncorrelated subquery in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/lookup/#mongodb-pipeline-pipe.-lookup"> <code class="leafygreen-ui-1l06pbn"> $lookup </code> </a> pipeline stage containing a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sample/#mongodb-pipeline-pipe.-sample"> <code class="leafygreen-ui-1l06pbn"> $sample </code> </a> stage, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sampleRate/#mongodb-expression-exp.-sampleRate"> <code class="leafygreen-ui-1l06pbn"> $sampleRate </code> </a> operator, or the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/rand/#mongodb-expression-exp.-rand"> <code class="leafygreen-ui-1l06pbn"> $rand </code> </a> operator, the subquery is always run again if repeated. Previously, depending on the subquery output size, either the subquery output was cached or the subquery was run again. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/lookup/#std-label-lookup-uncorrelated-subquery"> Perform an Uncorrelated Subquery with <code class="leafygreen-ui-1l06pbn"> $lookup </code> . </a> </p> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> <code class="leafygreen-ui-1l06pbn"> $sort </code> Stage: Performance Improvements <a class="headerlink leafygreen-ui-1kepx47" href="#-sort-stage--performance-improvements" 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="-sort-stage--performance-improvements"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-query-optimizer"> query optimizer </a> pushes down the results of a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/project/#mongodb-pipeline-pipe.-project"> <code class="leafygreen-ui-1l06pbn"> $project </code> </a> stage into the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sort/#mongodb-pipeline-pipe.-sort"> <code class="leafygreen-ui-1l06pbn"> $sort </code> </a> stage. As a result, <code class="leafygreen-ui-1l06pbn"> $sort </code> operations can require less RAM when used with the <code class="leafygreen-ui-1l06pbn"> project </code> stage and avoid <code class="leafygreen-ui-1l06pbn"> Sort exceeded memory limit </code> errors. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-auditing"> </span> </section> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Auditing <a class="headerlink leafygreen-ui-1kepx47" href="#auditing" 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="auditing"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Runtime Audit Filter Configuration <a class="headerlink leafygreen-ui-1kepx47" href="#runtime-audit-filter-configuration" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="runtime-audit-filter-configuration"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 adds the ability to <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-audit-filters/#std-label-configure-audit-filters-at-runtime"> configure auditing filters </a> at runtime. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Operator </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.auditConfigPollingFrequencySecs"> <code class="leafygreen-ui-1l06pbn"> auditConfigPollingFrequencySecs </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Defines the polling interval for checking audit configuration </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getAuditConfig/#mongodb-dbcommand-dbcmd.getAuditConfig"> <code class="leafygreen-ui-1l06pbn"> getAuditConfig </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Retrieves audit configurations from <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> . </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setAuditConfig/#mongodb-dbcommand-dbcmd.setAuditConfig"> <code class="leafygreen-ui-1l06pbn"> setAuditConfig </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Sets new audit configurations for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances at runtime. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> General Auditing Updates <a class="headerlink leafygreen-ui-1kepx47" href="#general-auditing-updates" 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="general-auditing-updates"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/#std-label-audit-message-format"> System event auditing </a> has: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> An additional <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/mongo/#std-label-audit-message-uuid"> uuid </a> field and other <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/#std-label-audit-message-format"> audit message </a> enhancements. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> New audit message types: <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/mongo/#std-label-audit-message-clientMetadata"> clientMetadata </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/mongo/#std-label-audit-message-directAuthMutation"> directAuthMutation </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/mongo/#std-label-audit-message-logout"> logout </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/mongo/#std-label-audit-message-startup"> startup <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Additional information and logging scenarios for these existing audit message types: <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/mongo/#std-label-audit-message-authCheck"> authCheck </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/mongo/#std-label-audit-message-authenticate"> authenticate </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/mongo/#std-label-audit-message-createCollection"> createCollection </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/mongo/#std-label-audit-message-createIndex"> createIndex </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/mongo/#std-label-audit-message-dropCollection"> dropCollection <!-- --> . </a> </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> DDL operations auditing on <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondaries </a> has changes. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/auditing/#std-label-auditing-audit-events-and-filter"> Audit Events and Filter <!-- --> . </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-capped-collections"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Capped Collections <a class="headerlink leafygreen-ui-1kepx47" href="#capped-collections" 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="capped-collections"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Capped Collection Deletes Are Replicated to Secondaries <a class="headerlink leafygreen-ui-1kepx47" href="#capped-collection-deletes-are-replicated-to-secondaries" 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="capped-collection-deletes-are-replicated-to-secondaries"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/capped-collections/#std-label-capped_collections_remove_documents"> implicit delete operations </a> for <a class="leafygreen-ui-tqgtui" href="/docs/manual/replication/#std-label-replication"> replica set </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-capped-collection"> capped collections </a> are processed by the primary and replicated to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-secondary/#std-label-replica-set-secondary-members-ref"> secondary members <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Explicit Deletes Allowed on Capped Collections <a class="headerlink leafygreen-ui-1kepx47" href="#explicit-deletes-allowed-on-capped-collections" 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-deletes-allowed-on-capped-collections"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0.7, you can delete documents from <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/capped-collections/#std-label-manual-capped-collection"> capped collections </a> using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/delete-methods/#std-label-delete-additional-methods"> delete methods <!-- --> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-change-streams"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Change Streams <a class="headerlink leafygreen-ui-1kepx47" href="#change-streams" 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"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Change Events Output <a class="headerlink leafygreen-ui-1kepx47" href="#change-events-output" 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-events-output"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/change-events/#std-label-change-events"> Change Events </a> contain the field <code class="leafygreen-ui-1l06pbn"> updateDescription.truncatedArrays </code> to record array truncations. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-indexes"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#indexes" 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="indexes"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Partial Indexes Behavior Change <a class="headerlink leafygreen-ui-1kepx47" href="#partial-indexes-behavior-change" 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="partial-indexes-behavior-change"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, multiple <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-partial/#std-label-index-type-partial"> partial indexes </a> can be created using the same <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndexes/#std-label-key_patterns"> key pattern </a> as long as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndexes/#std-label-partialFilterExpression"> partialFilterExpression </a> fields do not express equivalent filters. </p> <p class="leafygreen-ui-1kp3ins"> In earlier versions of MongoDB, creating multiple <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-partial/#std-label-index-type-partial"> partial indexes </a> is not allowed when using the same key pattern with different <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndexes/#std-label-partialFilterExpression"> partialFilterExpressions <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Unique Sparse Index Behavior Change <a class="headerlink leafygreen-ui-1kepx47" href="#unique-sparse-index-behavior-change" 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="unique-sparse-index-behavior-change"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-sparse/#std-label-sparse-unique-index"> unique sparse </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-properties/#std-label-unique-index"> unique non-sparse </a> indexes with the same <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndexes/#std-label-key_patterns"> key pattern </a> can exist on a single collection. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-sparse/#std-label-sparse-and-non-sparse_example"> unique sparse index creation </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Cannot Drop <code class="leafygreen-ui-1l06pbn"> Ready </code> Indexes During In-Progress Index Builds <a class="headerlink leafygreen-ui-1kepx47" href="#cannot-drop-ready-indexes-during-in-progress-index-builds" 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="cannot-drop-ready-indexes-during-in-progress-index-builds"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.dropIndexes/#mongodb-method-db.collection.dropIndexes"> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndexes() </code> </a> command cannot drop <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-creation/#std-label-index-build-process-ready"> ready indexes </a> if there are any in-progress index builds. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In versions 4.4.0-4.4.4 of MongoDB, this logic was not true due to a bug. </p> </li> </ul> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Foreground Validation May Fix Multikey Metadata Inconsistencies <a class="headerlink leafygreen-ui-1kepx47" href="#foreground-validation-may-fix-multikey-metadata-inconsistencies" 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="foreground-validation-may-fix-multikey-metadata-inconsistencies"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When run on a MongoDB deployment, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.validate/#mongodb-method-db.collection.validate"> <code class="leafygreen-ui-1l06pbn"> db.collection.validate() </code> </a> attempts to fix <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.validate/#std-label-validate-standalone-inconsistencies"> multikey metadata inconsistencies </a> of standalone deployments. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Removal of <code class="leafygreen-ui-1l06pbn"> geoHaystack </code> Index and the <code class="leafygreen-ui-1l06pbn"> geoSearch </code> Command <a class="headerlink leafygreen-ui-1kepx47" href="#removal-of-geohaystack-index-and-the-geosearch-command" 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="removal-of-geohaystack-index-and-the-geosearch-command"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 removes the deprecated <code class="leafygreen-ui-1l06pbn"> geoHaystack </code> index and <code class="leafygreen-ui-1l06pbn"> geoSearch </code> command. Use a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index"> 2d index </a> with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/geoNear/#mongodb-pipeline-pipe.-geoNear"> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </a> or one of the supported <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query-geospatial/#std-label-geospatial-query-selectors"> geospatial query operators </a> instead. </p> <p class="leafygreen-ui-1kp3ins"> Upgrading your MongoDB instance to 5.0 and setting <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-view-fcv"> featureCompatibilityVersion </a> to <code class="leafygreen-ui-1l06pbn"> 5.0 </code> will delete any pre-existing <code class="leafygreen-ui-1l06pbn"> geoHaystack </code> indexes. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> New Error Messages <a class="headerlink leafygreen-ui-1kepx47" href="#new-error-messages" 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="new-error-messages"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndex() </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndexes/#mongodb-method-db.collection.createIndexes"> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </a> operations have new error messages when options are specified incorrectly. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Interrupted Index Builds <a class="headerlink leafygreen-ui-1kepx47" href="#interrupted-index-builds" 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="interrupted-index-builds"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If a node in a replica set is cleanly shutdown or rolls back during an index build, the index build progress is now <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-creation/#std-label-index-operations-build-failure"> saved to disk </a> . When the server restarts, index creation resumes from the saved position. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> reIndex </code> Behavior Change <a class="headerlink leafygreen-ui-1kepx47" href="#reindex-behavior-change" 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="reindex-behavior-change"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/reIndex/#mongodb-dbcommand-dbcmd.reIndex"> <code class="leafygreen-ui-1l06pbn"> reIndex </code> </a> command and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.reIndex/#mongodb-method-db.collection.reIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.reIndex() </code> </a> shell method may only be run on <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-standalone"> standalone </a> instances. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-removed-commands"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Removed Commands <a class="headerlink leafygreen-ui-1kepx47" href="#removed-commands" 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="removed-commands"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, these database commands and <code class="leafygreen-ui-1l06pbn"> mongo </code> shell helper methods are removed: </p> <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> Removed Command </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Alternative </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.ensureIndex/#mongodb-method-db.collection.ensureIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.ensureIndex() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndex() </code> </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.resetError/#mongodb-method-db.resetError"> <code class="leafygreen-ui-1l06pbn"> db.resetError() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Not available </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/resetError/#mongodb-dbcommand-dbcmd.resetError"> <code class="leafygreen-ui-1l06pbn"> resetError </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Not available </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/shardConnPoolStats/#mongodb-dbcommand-dbcmd.shardConnPoolStats"> <code class="leafygreen-ui-1l06pbn"> shardConnPoolStats </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/connPoolStats/#mongodb-dbcommand-dbcmd.connPoolStats"> <code class="leafygreen-ui-1l06pbn"> connPoolStats </code> </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/unsetSharding/#mongodb-dbcommand-dbcmd.unsetSharding"> <code class="leafygreen-ui-1l06pbn"> unsetSharding </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Not available </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/geoSearch/#mongodb-dbcommand-dbcmd.geoSearch"> <code class="leafygreen-ui-1l06pbn"> geoSearch </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/geoNear/#mongodb-pipeline-pipe.-geoNear"> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </a> or one of the supported <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query-geospatial/#std-label-geospatial-query-selectors"> geospatial query operators </a> </div> </div> </td> </tr> </tbody> </table> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-repl-sets"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Replica Sets <a class="headerlink leafygreen-ui-1kepx47" href="#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="replica-sets"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Non-transactional Reads on <code class="leafygreen-ui-1l06pbn"> config.transactions </code> <a class="headerlink leafygreen-ui-1kepx47" href="#non-transactional-reads-on-config.transactions" 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="non-transactional-reads-on-config.transactions"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, non-transaction reads are not allowed on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/config-database/#mongodb-data-config.transactions"> <code class="leafygreen-ui-1l06pbn"> config.transactions </code> </a> collection with the following read concerns and options: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-snapshot/#mongodb-readconcern-readconcern.-snapshot-"> <code class="leafygreen-ui-1l06pbn"> "snapshot" </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern/#std-label-afterClusterTime"> afterClusterTime </a> option is set </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When using a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB Driver </span> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> within a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-isolation-consistency-recency/#std-label-sessions"> causally consistent session </a> </p> </li> </ul> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> hello </code> Command <a class="headerlink leafygreen-ui-1kepx47" href="#hello-command" 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="hello-command"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hello/#mongodb-dbcommand-dbcmd.hello"> <code class="leafygreen-ui-1l06pbn"> hello </code> </a> command and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.hello/#mongodb-method-db.hello"> <code class="leafygreen-ui-1l06pbn"> db.hello() </code> </a> method were introduced as replacements for the <code class="leafygreen-ui-1l06pbn"> isMaster </code> command and the <code class="leafygreen-ui-1l06pbn"> db.isMaster() </code> method. The new topology metric <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.connections.exhaustHello"> <code class="leafygreen-ui-1l06pbn"> connections.exhaustHello </code> </a> tracks this in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.connections"> <code class="leafygreen-ui-1l06pbn"> connections </code> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Quiesce Period <a class="headerlink leafygreen-ui-1kepx47" href="#quiesce-period" 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="quiesce-period"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> enter a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/shutdown/#std-label-shutdown-cmd-quiesce-period"> quiesce period </a> to allow any ongoing database operations to complete before shutting down. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Limit Removed for <code class="leafygreen-ui-1l06pbn"> members[n]._id </code> Values <a class="headerlink leafygreen-ui-1kepx47" href="#limit-removed-for-members-n-._id-values" 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="limit-removed-for-members-n-._id-values"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-._id"> <code class="leafygreen-ui-1l06pbn"> members[n]._id </code> </a> field may be any integer value greater than or equal to <code class="leafygreen-ui-1l06pbn"> 0 </code> . Previously, this value was limited to an integer between <code class="leafygreen-ui-1l06pbn"> 0 </code> and <code class="leafygreen-ui-1l06pbn"> 255 </code> inclusive. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> enableMajorityReadConcern </code> Is Not Configurable <a class="headerlink leafygreen-ui-1kepx47" href="#enablemajorityreadconcern-is-not-configurable" 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="enablemajorityreadconcern-is-not-configurable"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.enableMajorityReadConcern"> <code class="leafygreen-ui-1l06pbn"> enableMajorityReadConcern </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--enableMajorityReadConcern"> <code class="leafygreen-ui-1l06pbn"> --enableMajorityReadConcern </code> </a> cannot be changed and are always set to <code class="leafygreen-ui-1l06pbn"> true </code> due to storage engine improvements. </p> <p class="leafygreen-ui-1kp3ins"> In earlier versions of MongoDB, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.enableMajorityReadConcern"> <code class="leafygreen-ui-1l06pbn"> enableMajorityReadConcern </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--enableMajorityReadConcern"> <code class="leafygreen-ui-1l06pbn"> --enableMajorityReadConcern </code> </a> are configurable and can be set to <code class="leafygreen-ui-1l06pbn"> false </code> to prevent storage cache pressure from immobilizing a deployment with a three-member primary-secondary-arbiter (PSA) architecture. </p> <p class="leafygreen-ui-1kp3ins"> If you are using a three-member primary-secondary-arbiter (PSA) architecture, consider the following: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The write concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> can cause performance issues if a secondary is unavailable or lagging. For advice on how to mitigate these issues, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/mitigate-psa-performance-issues/#std-label-performance-issues-psa"> Mitigate Performance Issues with a Self-Managed PSA Replica Set <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you are using a global default <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> and the write concern is less than the size of the majority, your queries may return stale (not fully replicated) data. </p> </li> </ul> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Enhanced Thread Pool Timeout Control <a class="headerlink leafygreen-ui-1kepx47" href="#enhanced-thread-pool-timeout-control" 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="enhanced-thread-pool-timeout-control"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, you can use the new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.replWriterMinThreadCount"> <code class="leafygreen-ui-1l06pbn"> replWriterMinThreadCount </code> </a> server parameter to allow idle threads above this minimum to be closed. When <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.replWriterMinThreadCount"> <code class="leafygreen-ui-1l06pbn"> replWriterMinThreadCount </code> </a> is configured with a value less than <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.replWriterThreadCount"> <code class="leafygreen-ui-1l06pbn"> replWriterThreadCount </code> </a> , idle threads above <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.replWriterMinThreadCount"> <code class="leafygreen-ui-1l06pbn"> replWriterMinThreadCount </code> </a> are timed out. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Reconfiguring PSA Replica Sets <a class="headerlink leafygreen-ui-1kepx47" href="#reconfiguring-psa-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="reconfiguring-psa-replica-sets"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When reconfiguring primary-secondary-arbiter (PSA) replica sets or changing to a PSA architecture, it is now in some cases required to perform the reconfiguration in a two-step change. MongoDB 5.0 introduces the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.reconfigForPSASet/#mongodb-method-rs.reconfigForPSASet"> <code class="leafygreen-ui-1l06pbn"> rs.reconfigForPSASet() </code> </a> method which performs both steps. If you cannot use the helper method, follow the procedure in <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/modify-psa-replica-set-safely/#std-label-modify-psa-replica-set-safely"> Modify a Self-Managed PSA Replica Set Safely <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Limit Sync Source Re-evaluations <a class="headerlink leafygreen-ui-1kepx47" href="#limit-sync-source-re-evaluations" 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="limit-sync-source-re-evaluations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.maxNumSyncSourceChangesPerHour"> <code class="leafygreen-ui-1l06pbn"> maxNumSyncSourceChangesPerHour </code> </a> determines how many sync source changes can happen per hour before the node temporarily stops re-evaluating a sync source. This parameter will not prevent a node from starting to sync from another node if it doesn't have a sync source. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> enableOverrideClusterChainingSetting </code> Server Parameter <a class="headerlink leafygreen-ui-1kepx47" href="#enableoverrideclusterchainingsetting-server-parameter" 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="enableoverrideclusterchainingsetting-server-parameter"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0.2, you can set the new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.enableOverrideClusterChainingSetting"> <code class="leafygreen-ui-1l06pbn"> enableOverrideClusterChainingSetting </code> </a> server parameter to <code class="leafygreen-ui-1l06pbn"> true </code> to allow <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondary </a> members to replicate data from other secondary members even if <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.settings.chainingAllowed"> <code class="leafygreen-ui-1l06pbn"> settings.chainingAllowed </code> </a> is <code class="leafygreen-ui-1l06pbn"> false </code> . </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-security"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Security <a class="headerlink leafygreen-ui-1kepx47" href="#security" 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="security"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Support for Online Certificate Rotation <a class="headerlink leafygreen-ui-1kepx47" href="#support-for-online-certificate-rotation" 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="support-for-online-certificate-rotation"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, you may now rotate the following TLS certificates on demand without first needing to stop your running <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.certificateKeyFile"> <code class="leafygreen-ui-1l06pbn"> TLS Certificates </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.CRLFile"> <code class="leafygreen-ui-1l06pbn"> CRL (Certificate Revocation List) files </code> </a> (on Linux and Windows platforms) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.CAFile"> <code class="leafygreen-ui-1l06pbn"> CA (Certificate Authority) files </code> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> To rotate these certificates, replace the certificate files on your filesystem with updated versions, then use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/rotateCertificates/#mongodb-dbcommand-dbcmd.rotateCertificates"> <code class="leafygreen-ui-1l06pbn"> rotateCertificates </code> </a> command or the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.rotateCertificates/#mongodb-method-db.rotateCertificates"> <code class="leafygreen-ui-1l06pbn"> db.rotateCertificates() </code> </a> shell method to trigger certificate rotation. </p> <p class="leafygreen-ui-1kp3ins"> Rotating certificates in this manner does not require downtime, and does not drop any active remote connections. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/#std-label-certificate-rotation"> Online Certificate Rotation </a> for full details. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Support for Configuring TLS 1.3 Cipher Suites <a class="headerlink leafygreen-ui-1kepx47" href="#support-for-configuring-tls-1.3-cipher-suites" 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="support-for-configuring-tls-1.3-cipher-suites"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 introduces the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.opensslCipherSuiteConfig"> <code class="leafygreen-ui-1l06pbn"> opensslCipherSuiteConfig </code> </a> parameter to enable configuration of the supported cipher suites OpenSSL should permit when using TLS 1.3 encryption. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> TLS Connection X509 Certificate Startup Warning <a class="headerlink leafygreen-ui-1kepx47" href="#tls-connection-x509-certificate-startup-warning" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="tls-connection-x509-certificate-startup-warning"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> now issue a startup warning when their certificates do not include a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-Subject-Alternative-Name"> Subject Alternative Name </a> attribute. </p> <p class="leafygreen-ui-1kp3ins"> The following platforms do not support common name validation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> iOS 13 and higher </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MacOS 10.15 and higher </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Go 1.15 and higher </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Clients using these platforms will not <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-x509-client-authentication/#std-label-x509-client-authentication"> authenticate </a> to MongoDB servers that use x.509 certificates whose hostnames are <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-label-KMIP-subject-alternative-name-CN"> specified by CommonName attributes <!-- --> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-sharded-clusters"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> ApplyOps Privilege Action <a class="headerlink leafygreen-ui-1kepx47" href="#applyops-privilege-action" 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="applyops-privilege-action"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 introduces the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-applyOps"> <code class="leafygreen-ui-1l06pbn"> applyOps </code> </a> privilege action which is inherited by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-dbAdminAnyDatabase"> <code class="leafygreen-ui-1l06pbn"> dbAdminAnyDatabase </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-applyOps"> <code class="leafygreen-ui-1l06pbn"> applyOps </code> </a> action permits users to run the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/applyOps/#mongodb-dbcommand-dbcmd.applyOps"> <code class="leafygreen-ui-1l06pbn"> applyOps </code> </a> database command. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Sharded Clusters <a class="headerlink leafygreen-ui-1kepx47" href="#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="sharded-clusters"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Resharding <a class="headerlink leafygreen-ui-1kepx47" href="#resharding" 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="resharding"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The ideal shard key allows MongoDB to distribute documents evenly throughout the cluster while facilitating common query patterns. A suboptimal shard key can lead to performance or scaling issues due to uneven data distribution. Starting in MongoDB 5.0, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/reshardCollection/#mongodb-dbcommand-dbcmd.reshardCollection"> <code class="leafygreen-ui-1l06pbn"> reshardCollection </code> </a> command to <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-change-a-shard-key/#std-label-change-a-shard-key"> change the shard key </a> for a collection to change the distribution of your data across your cluster. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> currentOp </code> Reports Ongoing Resharding Operations <a class="headerlink leafygreen-ui-1kepx47" href="#currentop-reports-ongoing-resharding-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="currentop-reports-ongoing-resharding-operations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/currentOp/#mongodb-pipeline-pipe.-currentOp"> <code class="leafygreen-ui-1l06pbn"> $currentOp </code> </a> aggregation stage (and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-dbcommand-dbcmd.currentOp"> <code class="leafygreen-ui-1l06pbn"> currentOp </code> </a> command and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.currentOp/#mongodb-method-db.currentOp"> <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> </a> shell method) include additional information about the status of ongoing resharding operations for the resharding coordinator and the donor and recipient shards. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> db.currentOp </code> Method Now Uses Aggregation Stage in <code class="leafygreen-ui-1l06pbn"> mongosh </code> <a class="headerlink leafygreen-ui-1kepx47" href="#db.currentop-method-now-uses-aggregation-stage-in-mongosh" 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.currentop-method-now-uses-aggregation-stage-in-mongosh"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/currentOp/#mongodb-pipeline-pipe.-currentOp"> <code class="leafygreen-ui-1l06pbn"> $currentOp </code> </a> aggregation stage is used when running the helper method <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.currentOp/#mongodb-method-db.currentOp"> <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> </a> with <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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> mongos </code> / <code class="leafygreen-ui-1l06pbn"> mongod </code> Connection Pool <a class="headerlink leafygreen-ui-1kepx47" href="#mongos---mongod-connection-pool" 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="mongos---mongod-connection-pool"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, MongoDB adds the parameter option <code class="leafygreen-ui-1l06pbn"> "automatic" </code> as the new default for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.ShardingTaskExecutorPoolReplicaSetMatching"> <code class="leafygreen-ui-1l06pbn"> ShardingTaskExecutorPoolReplicaSetMatching </code> </a> . When set for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , the instance follows the behavior specified for the <code class="leafygreen-ui-1l06pbn"> "matchPrimaryNode" </code> option. When set for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> , the instance follows the behavior specified for the <code class="leafygreen-ui-1l06pbn"> "disabled" </code> option. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> renameCollection </code> Compatible with Sharded Collections <a class="headerlink leafygreen-ui-1kepx47" href="#renamecollection-compatible-with-sharded-collections" 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="renamecollection-compatible-with-sharded-collections"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/renameCollection/#mongodb-dbcommand-dbcmd.renameCollection"> <code class="leafygreen-ui-1l06pbn"> renameCollection </code> </a> command to change the name of a sharded collection. </p> <p class="leafygreen-ui-1kp3ins"> When renaming a sharded or unsharded collection in a sharded cluster, the source and target collections are exclusively locked on every shard. Subsequent operations on the source and target collections must wait until the rename operation completes. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> movePrimary </code> Error Message For Writes During Operation <a class="headerlink leafygreen-ui-1kepx47" href="#moveprimary-error-message-for-writes-during-operation" 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="moveprimary-error-message-for-writes-during-operation"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, when using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/movePrimary/#mongodb-dbcommand-dbcmd.movePrimary"> <code class="leafygreen-ui-1l06pbn"> movePrimary </code> </a> command to remove a shard from a <a class="leafygreen-ui-tqgtui" href="/docs/manual/sharding/#std-label-sharded-cluster"> sharded cluster </a> , writes to the original shard will generate an error message. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Split and Merge Chunk Changelogs Show Owning Shard <a class="headerlink leafygreen-ui-1kepx47" href="#split-and-merge-chunk-changelogs-show-owning-shard" 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="split-and-merge-chunk-changelogs-show-owning-shard"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, documents in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/config-database/#mongodb-data-config.changelog"> <code class="leafygreen-ui-1l06pbn"> config.changelog </code> </a> collection for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/tutorial/split-chunks-in-sharded-cluster/" target="_self"> <span> split </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/tutorial/merge-chunks-in-sharded-cluster/" target="_self"> <span> merge </span> </a> operations contain an <code class="leafygreen-ui-1l06pbn"> owningShard </code> field. The <code class="leafygreen-ui-1l06pbn"> owningShard </code> field shows the <code class="leafygreen-ui-1l06pbn"> shardId </code> of the shard that owns the chunks that were split or merged. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> owningShard </code> field helps identify shards where split or merge operations frequently occur. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> maxCatchUpPercentageBeforeBlockingWrites </code> Server Parameter <a class="headerlink leafygreen-ui-1kepx47" href="#maxcatchuppercentagebeforeblockingwrites-server-parameter" 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="maxcatchuppercentagebeforeblockingwrites-server-parameter"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, you can set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.maxCatchUpPercentageBeforeBlockingWrites"> <code class="leafygreen-ui-1l06pbn"> maxCatchUpPercentageBeforeBlockingWrites </code> </a> to specify the maximum allowed percentage of data not yet migrated during a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/moveChunk/#mongodb-dbcommand-dbcmd.moveChunk"> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> </a> operation when compared to the total size (in MBs) of the chunk being transferred. </p> <p class="leafygreen-ui-1kp3ins"> This parameter can affect the behavior of: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/moveChunk/#mongodb-dbcommand-dbcmd.moveChunk"> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> </a> commands that are run manually. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Load balancer functionality, which automatically runs multiple <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/moveChunk/#mongodb-dbcommand-dbcmd.moveChunk"> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> </a> commands to evenly distribute chunks across shards. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-balancer-administration/#std-label-sharding-balancing"> Sharded Cluster Balancer <!-- --> . </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-shell"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Shell Changes <a class="headerlink leafygreen-ui-1kepx47" href="#shell-changes" 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="shell-changes"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> New MongoDB Shell: <code class="leafygreen-ui-1l06pbn"> mongosh </code> <a class="headerlink leafygreen-ui-1kepx47" href="#new-mongodb-shell--mongosh" 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="new-mongodb-shell--mongosh"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> mongo </code> shell has been deprecated in MongoDB v5.0. The replacement shell is <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> . The legacy <code class="leafygreen-ui-1l06pbn"> mongo </code> shell will be removed in a future release. </p> <p class="leafygreen-ui-1kp3ins"> Shell packaging also changes in MongoDB v5.0. Refer to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/install/" target="_self"> <span> installation instructions </span> </a> for further details. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Shell Support for GCP and Azure KMS Providers <a class="headerlink leafygreen-ui-1kepx47" href="#shell-support-for-gcp-and-azure-kms-providers" 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="shell-support-for-gcp-and-azure-kms-providers"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the Google Cloud Platform KMS and Azure Key Vault are supported in both <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 the legacy <code class="leafygreen-ui-1l06pbn"> mongo </code> shell as <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers"> Key Management Service (KMS) </a> providers for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/#std-label-manual-csfle-feature"> Client-Side Field Level Encryption <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Using a KMS, you can centrally and securely store Customer Master Keys (CMKs), which are used to encrypt and decrypt data encryption keys as part of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/reference/encryption-components/#std-label-csfle-encryption-components"> client-side field level encryption workflow <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> In addition, a configured KMS allows for the use of <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/reference/decryption/#std-label-field-level-encryption-automatic-decryption"> How CSFLE Decrypts Documents </a> of data fields when used with MongoDB Enterprise. </p> <p class="leafygreen-ui-1kp3ins"> To learn more, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/field-level-encryption/" target="_self"> <span> Configure a KMS provider using mongosh <!-- --> . </span> </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-snapshot-reads"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Snapshots <a class="headerlink leafygreen-ui-1kepx47" href="#snapshots" 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="snapshots"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Extended Support for Read Concern <code class="leafygreen-ui-1l06pbn"> "snapshot" </code> <a class="headerlink leafygreen-ui-1kepx47" href="#extended-support-for-read-concern--snapshot-" 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="extended-support-for-read-concern--snapshot-"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, read concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-snapshot/#mongodb-readconcern-readconcern.-snapshot-"> <code class="leafygreen-ui-1l06pbn"> "snapshot" </code> </a> is supported for some read operations outside of multi-document transactions on primaries and secondaries. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/long-running-queries/#std-label-tutorial-long-running-queries"> Perform Long-Running Snapshot Queries <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> minSnapshotHistoryWindowInSeconds </code> Server Parameter <a class="headerlink leafygreen-ui-1kepx47" href="#minsnapshothistorywindowinseconds-server-parameter" 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="minsnapshothistorywindowinseconds-server-parameter"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.minSnapshotHistoryWindowInSeconds"> <code class="leafygreen-ui-1l06pbn"> minSnapshotHistoryWindowInSeconds </code> </a> parameter to control how long WiredTiger keeps the snapshot history. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-transactions"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Transactions <a class="headerlink leafygreen-ui-1kepx47" href="#transactions" 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="transactions"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> coordinateCommitReturnImmediatelyAfterPersistingDecision </code> Parameter <a class="headerlink leafygreen-ui-1kepx47" href="#coordinatecommitreturnimmediatelyafterpersistingdecision-parameter" 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="coordinatecommitreturnimmediatelyafterpersistingdecision-parameter"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The server parameter <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.coordinateCommitReturnImmediatelyAfterPersistingDecision"> <code class="leafygreen-ui-1l06pbn"> coordinateCommitReturnImmediatelyAfterPersistingDecision </code> </a> controls when transaction commit decisions are returned to the client. </p> <p class="leafygreen-ui-1kp3ins"> The parameter was introduced in MongDB 5.0 with a default value of <code class="leafygreen-ui-1l06pbn"> true </code> . In MongoDB 6.1 the default value changes to <code class="leafygreen-ui-1l06pbn"> false </code> . </p> <p class="leafygreen-ui-1kp3ins"> When <code class="leafygreen-ui-1l06pbn"> coordinateCommitReturnImmediatelyAfterPersistingDecision </code> is <code class="leafygreen-ui-1l06pbn"> false </code> , the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-shards/#std-label-shards-concepts"> shard </a> transaction coordinator waits for all members to acknowledge a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions-atomicity"> multi-document transaction </a> commit before returning the commit decision to the client. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Naming Changes <a class="headerlink leafygreen-ui-1kepx47" href="#naming-changes" 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="naming-changes"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in February 2022, the "Versioned API" terminology was changed to "Stable API". All concepts and features remain the same with this naming change. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-general"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> General Changes <a class="headerlink leafygreen-ui-1kepx47" href="#general-changes" 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="general-changes"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Execution Plan Statistics for Query with <code class="leafygreen-ui-1l06pbn"> $lookup </code> Pipeline Stage <a class="headerlink leafygreen-ui-1kepx47" href="#execution-plan-statistics-for-query-with--lookup-pipeline-stage" 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="execution-plan-statistics-for-query-with--lookup-pipeline-stage"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 adds <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/explain-results/#std-label-explain-results-lookup"> execution plan statistics </a> for queries that use a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/lookup/#mongodb-pipeline-pipe.-lookup"> <code class="leafygreen-ui-1l06pbn"> $lookup </code> </a> pipeline stage. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Improved Handling of ( <code class="leafygreen-ui-1l06pbn"> $ </code> ) and ( <code class="leafygreen-ui-1l06pbn"> . </code> ) in Field Names <a class="headerlink leafygreen-ui-1kepx47" href="#improved-handling-of-----and--.--in-field-names" 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="improved-handling-of-----and--.--in-field-names"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 adds <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/dot-dollar-considerations/#std-label-crud-concepts-dot-dollar-considerations"> improved support </a> for field names that are ( <code class="leafygreen-ui-1l06pbn"> $ </code> ) prefixed or that contain ( <code class="leafygreen-ui-1l06pbn"> . </code> ) characters. The validation rules for storing data have been updated to make it easier to work with data sources that use these characters. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Cluster Wide Default Write Concern <a class="headerlink leafygreen-ui-1kepx47" href="#cluster-wide-default-write-concern" 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="cluster-wide-default-write-concern"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, once the Cluster Wide Write Concern (CWWC) is set via the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setDefaultRWConcern/#mongodb-dbcommand-dbcmd.setDefaultRWConcern"> <code class="leafygreen-ui-1l06pbn"> setDefaultRWConcern </code> </a> command the write concern cannot be unset. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Implicit Default Write Concern <a class="headerlink leafygreen-ui-1kepx47" href="#implicit-default-write-concern" 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="implicit-default-write-concern"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the implicit default <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern"> write concern </a> is <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> w: majority </code> </a> . However, special considerations are made for deployments containing <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-arbiter/#std-label-replica-set-arbiter-configuration"> arbiters <!-- --> : </a> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The voting majority of a replica set is 1 plus half the number of voting members, rounded down. If the number of data-bearing voting members is not greater than the voting majority, the default write concern is <code class="leafygreen-ui-1l06pbn"> { w: 1 } </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In all other scenarios, the default write concern is <code class="leafygreen-ui-1l06pbn"> { w: "majority" } </code> . </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Specifically, MongoDB uses the following formula to determine the default write concern: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"if [ (#arbiters &gt; 0) AND (#non-arbiters &lt;= majority(#voting-nodes)) ]\n defaultWriteConcern = { w: 1 }\nelse\n defaultWriteConcern = { w: \"majority\" }"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">if [ (#arbiters &gt; 0) AND (#non-arbiters &lt;= majority(#voting-nodes)) ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> defaultWriteConcern = { w: 1 }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">else</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> defaultWriteConcern = { w: "majority" }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For example, consider the following deployments and their respective default write concerns: </p> <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> Non-Arbiters </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Arbiters </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Voting Nodes </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Majority of Voting Nodes </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Implicit Default Write Concern </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 2 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 1 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 3 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 2 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { w: 1 } </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 4 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 1 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 3 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { w: "majority" } </code> </div> </div> </td> </tr> </tbody> </table> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In the first example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> There are 2 non-arbiters and 1 arbiter for a total of 3 voting nodes. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The majority of voting nodes (1 plus half of 3, rounded down) is 2. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The number of non-arbiters (2) is equal to the majority of voting nodes (2), resulting in an implicit write concern of <code class="leafygreen-ui-1l06pbn"> { w: 1 } </code> . </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In the second example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> There are 4 non-arbiters and 1 arbiter for a total of 5 voting nodes. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The majority of voting nodes (1 plus half of 5, rounded down) is 3. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The number of non-arbiters (4) is greater than the majority of voting nodes (3), resulting in an implicit write concern of <code class="leafygreen-ui-1l06pbn"> { w: "majority" } </code> . </p> </li> </ul> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> { w: "majority" } </code> </a> default <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern"> write concern </a> provides a stronger durability guarantee in the event of an election, or if replica set members become unavailable. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> mongosShutdownTimeoutMillisForSignaledShutdown </code> Parameter <a class="headerlink leafygreen-ui-1kepx47" href="#mongosshutdowntimeoutmillisforsignaledshutdown-parameter" 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="mongosshutdowntimeoutmillisforsignaledshutdown-parameter"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the new parameter <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.mongosShutdownTimeoutMillisForSignaledShutdown"> <code class="leafygreen-ui-1l06pbn"> mongosShutdownTimeoutMillisForSignaledShutdown </code> </a> specifies the time in milliseconds to wait for any ongoing database operations to complete before initiating a shutdown of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Configurable <code class="leafygreen-ui-1l06pbn"> zstd </code> Compression Level <a class="headerlink leafygreen-ui-1kepx47" href="#configurable-zstd-compression-level" 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="configurable-zstd-compression-level"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 introduces the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.wiredTiger.engineConfig.zstdCompressionLevel"> <code class="leafygreen-ui-1l06pbn"> zstdCompressionLevel </code> </a> configuration file option which allows for configurable compression levels when <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.wiredTiger.collectionConfig.blockCompressor"> <code class="leafygreen-ui-1l06pbn"> blockCompressor </code> </a> is set to <code class="leafygreen-ui-1l06pbn"> zstd </code> . </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Lock-Free Read Operations <a class="headerlink leafygreen-ui-1kepx47" href="#lock-free-read-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="lock-free-read-operations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the following read operations are not blocked when another operation holds an exclusive (X) write lock on the collection: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/find/#mongodb-dbcommand-dbcmd.find"> <code class="leafygreen-ui-1l06pbn"> find </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/count/#mongodb-dbcommand-dbcmd.count"> <code class="leafygreen-ui-1l06pbn"> count </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/distinct/#mongodb-dbcommand-dbcmd.distinct"> <code class="leafygreen-ui-1l06pbn"> distinct </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/aggregate/#mongodb-dbcommand-dbcmd.aggregate"> <code class="leafygreen-ui-1l06pbn"> aggregate </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/mapReduce/#mongodb-dbcommand-dbcmd.mapReduce"> <code class="leafygreen-ui-1l06pbn"> mapReduce </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/listCollections/#mongodb-dbcommand-dbcmd.listCollections"> <code class="leafygreen-ui-1l06pbn"> listCollections </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/listIndexes/#mongodb-dbcommand-dbcmd.listIndexes"> <code class="leafygreen-ui-1l06pbn"> listIndexes </code> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> When writing to a collection, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/mapReduce/#mongodb-dbcommand-dbcmd.mapReduce"> <code class="leafygreen-ui-1l06pbn"> mapReduce </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/aggregate/#mongodb-dbcommand-dbcmd.aggregate"> <code class="leafygreen-ui-1l06pbn"> aggregate </code> </a> hold an intent exclusive (IX) lock. Therefore, if an exclusive X lock is already held on a collection, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/mapReduce/#mongodb-dbcommand-dbcmd.mapReduce"> <code class="leafygreen-ui-1l06pbn"> mapReduce </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/aggregate/#mongodb-dbcommand-dbcmd.aggregate"> <code class="leafygreen-ui-1l06pbn"> aggregate </code> </a> write operations are blocked. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Schema Validation Failures Explained <a class="headerlink leafygreen-ui-1kepx47" href="#schema-validation-failures-explained" 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="schema-validation-failures-explained"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 adds detailed explanations when a document fails <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/schema-validation/#std-label-schema-validation-overview"> schema validation <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Repair Option in <code class="leafygreen-ui-1l06pbn"> validate </code> Command <a class="headerlink leafygreen-ui-1kepx47" href="#repair-option-in-validate-command" 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="repair-option-in-validate-command"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/validate/#mongodb-dbcommand-dbcmd.validate"> <code class="leafygreen-ui-1l06pbn"> validate </code> </a> command and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.validate/#mongodb-method-db.collection.validate"> <code class="leafygreen-ui-1l06pbn"> db.collection.validate() </code> </a> helper method have a new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/validate/#std-label-cmd-validate-repair"> repair </a> option for repairing a collection that has inconsistencies. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/validate/#mongodb-dbcommand-dbcmd.validate"> <code class="leafygreen-ui-1l06pbn"> validate </code> </a> command and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.validate/#mongodb-method-db.collection.validate"> <code class="leafygreen-ui-1l06pbn"> db.collection.validate() </code> </a> helper method also return a new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/validate/#mongodb-data-validate.repaired"> <code class="leafygreen-ui-1l06pbn"> repaired </code> </a> boolean value that is <code class="leafygreen-ui-1l06pbn"> true </code> if the collection was repaired. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> validate </code> Command Reports Document Schema Violations <a class="headerlink leafygreen-ui-1kepx47" href="#validate-command-reports-document-schema-violations" 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="validate-command-reports-document-schema-violations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/validate/#mongodb-dbcommand-dbcmd.validate"> <code class="leafygreen-ui-1l06pbn"> validate </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.validate/#mongodb-method-db.collection.validate"> <code class="leafygreen-ui-1l06pbn"> db.collection.validate() </code> </a> validates documents in a collection. The commands report if any <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/schema-validation/#std-label-schema-validation-document"> schema validation rules </a> are violated. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Repair Option in <code class="leafygreen-ui-1l06pbn"> mongod </code> <a class="headerlink leafygreen-ui-1kepx47" href="#repair-option-in-mongod" 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="repair-option-in-mongod"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--repair"> <code class="leafygreen-ui-1l06pbn"> --repair </code> </a> option for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> validates the collections to find any inconsistencies and fixes them if possible, which avoids rebuilding the indexes. See the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--repair"> <code class="leafygreen-ui-1l06pbn"> --repair </code> </a> option for usage and limitations. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> corruptRecords </code> Field in Validation Output <a class="headerlink leafygreen-ui-1kepx47" href="#corruptrecords-field-in-validation-output" 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="corruptrecords-field-in-validation-output"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/validate/#mongodb-dbcommand-dbcmd.validate"> <code class="leafygreen-ui-1l06pbn"> validate </code> </a> command and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.validate/#mongodb-method-db.collection.validate"> <code class="leafygreen-ui-1l06pbn"> db.collection.validate() </code> </a> helper method return a new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/validate/#mongodb-data-validate.corruptRecords"> <code class="leafygreen-ui-1l06pbn"> corruptRecords </code> </a> field that contains an array of <code class="leafygreen-ui-1l06pbn"> RecordId </code> values for corrupt documents. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> maxValidateMemoryUsageMB </code> Server Parameter <a class="headerlink leafygreen-ui-1kepx47" href="#maxvalidatememoryusagemb-server-parameter" 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="maxvalidatememoryusagemb-server-parameter"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setParameter/#mongodb-dbcommand-dbcmd.setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> command has a new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.maxValidateMemoryUsageMB"> <code class="leafygreen-ui-1l06pbn"> maxValidateMemoryUsageMB </code> </a> parameter, which sets the maximum memory usage for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/validate/#mongodb-dbcommand-dbcmd.validate"> <code class="leafygreen-ui-1l06pbn"> validate </code> </a> command. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> findChunksOnConfigTimeoutMS </code> Server Parameter <a class="headerlink leafygreen-ui-1kepx47" href="#findchunksonconfigtimeoutms-server-parameter" 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="findchunksonconfigtimeoutms-server-parameter"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.findChunksOnConfigTimeoutMS"> <code class="leafygreen-ui-1l06pbn"> findChunksOnConfigTimeoutMS </code> </a> parameter to change the timeout for find operations on <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/config-database/#mongodb-data-config.chunks"> <code class="leafygreen-ui-1l06pbn"> chunks </code> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Database Profiler <code class="leafygreen-ui-1l06pbn"> filter </code> Option <a class="headerlink leafygreen-ui-1kepx47" href="#database-profiler-filter-option" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="database-profiler-filter-option"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, you can set a <code class="leafygreen-ui-1l06pbn"> filter </code> option for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-the-database-profiler/#std-label-database-profiler"> database profiler </a> to determine which operations are profiled and logged. You can use the <code class="leafygreen-ui-1l06pbn"> filter </code> expression in place of the <code class="leafygreen-ui-1l06pbn"> slowms </code> and <code class="leafygreen-ui-1l06pbn"> sampleRate </code> profiler options. </p> <p class="leafygreen-ui-1kp3ins"> See: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-the-database-profiler/#std-label-database-profiler"> Database Profiler </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.setProfilingLevel/#mongodb-method-db.setProfilingLevel"> <code class="leafygreen-ui-1l06pbn"> db.setProfilingLevel() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/profile/#mongodb-dbcommand-dbcmd.profile"> <code class="leafygreen-ui-1l06pbn"> profile </code> </a> </p> </li> </ul> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Log Changes to Database Profiler Settings <a class="headerlink leafygreen-ui-1kepx47" href="#log-changes-to-database-profiler-settings" 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="log-changes-to-database-profiler-settings"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, changes made to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-the-database-profiler/#std-label-database-profiler"> database profiler </a> <code class="leafygreen-ui-1l06pbn"> level </code> , <code class="leafygreen-ui-1l06pbn"> slowms </code> , <code class="leafygreen-ui-1l06pbn"> sampleRate </code> , or <code class="leafygreen-ui-1l06pbn"> filter </code> using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/profile/#mongodb-dbcommand-dbcmd.profile"> <code class="leafygreen-ui-1l06pbn"> profile </code> </a> command or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.setProfilingLevel/#mongodb-method-db.setProfilingLevel"> <code class="leafygreen-ui-1l06pbn"> db.setProfilingLevel() </code> </a> wrapper method are recorded in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--logpath"> <code class="leafygreen-ui-1l06pbn"> log file </code> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Independent Log Rotation for Server and Audit Logs <a class="headerlink leafygreen-ui-1kepx47" href="#independent-log-rotation-for-server-and-audit-logs" 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="independent-log-rotation-for-server-and-audit-logs"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, when <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/auditing/#std-label-auditing"> auditing </a> is enabled, you may now rotate the server and audit logs independently using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/logRotate/#mongodb-dbcommand-dbcmd.logRotate"> <code class="leafygreen-ui-1l06pbn"> logRotate </code> </a> command. Previously, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/logRotate/#mongodb-dbcommand-dbcmd.logRotate"> <code class="leafygreen-ui-1l06pbn"> logRotate </code> </a> would rotate the two logs together. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> remote </code> Field in Slow Operation Logs <a class="headerlink leafygreen-ui-1kepx47" href="#remote-field-in-slow-operation-logs" 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="remote-field-in-slow-operation-logs"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-the-database-profiler/#std-label-database-profiling-specify-slowms-threshold"> slow operation </a> log messages include a <code class="leafygreen-ui-1l06pbn"> remote </code> field specifying client IP address. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> remoteOpWaitMillis </code> Log Field <a class="headerlink leafygreen-ui-1kepx47" href="#remoteopwaitmillis-log-field" 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="remoteopwaitmillis-log-field"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-messages-remoteOpWaitMillis"> remoteOpWaitMillis </a> log field to obtain the wait time for results from <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard"> shards <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> resolvedViews </code> Log Field for Slow Queries on Views <a class="headerlink leafygreen-ui-1kepx47" href="#resolvedviews-log-field-for-slow-queries-on-views" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="resolvedviews-log-field-for-slow-queries-on-views"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-message-slow-ops"> log messages for slow queries </a> on <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-message-view-example"> views </a> include a <code class="leafygreen-ui-1l06pbn"> resolvedViews </code> field that contains the view details. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Define Variables Using the <code class="leafygreen-ui-1l06pbn"> let </code> Option <a class="headerlink leafygreen-ui-1kepx47" href="#define-variables-using-the-let-option" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="define-variables-using-the-let-option"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the following commands have a <code class="leafygreen-ui-1l06pbn"> let </code> option to define a list of variables. This allows you to improve command readability by separating the variables from the query text. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/find/#mongodb-dbcommand-dbcmd.find"> <code class="leafygreen-ui-1l06pbn"> find </code> </a> command </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/findAndModify/#mongodb-dbcommand-dbcmd.findAndModify"> <code class="leafygreen-ui-1l06pbn"> findAndModify </code> </a> command and corresponding <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findAndModify/#mongodb-method-db.collection.findAndModify"> <code class="leafygreen-ui-1l06pbn"> db.collection.findAndModify() </code> </a> shell helper </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/update/#mongodb-dbcommand-dbcmd.update"> <code class="leafygreen-ui-1l06pbn"> update </code> </a> command and corresponding <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.update/#mongodb-method-db.collection.update"> <code class="leafygreen-ui-1l06pbn"> db.collection.update() </code> </a> shell helper </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/delete/#mongodb-dbcommand-dbcmd.delete"> <code class="leafygreen-ui-1l06pbn"> delete </code> </a> command </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.remove/#mongodb-method-db.collection.remove"> <code class="leafygreen-ui-1l06pbn"> db.collection.remove() </code> </a> shell helper </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/update/#mongodb-dbcommand-dbcmd.update"> <code class="leafygreen-ui-1l06pbn"> update </code> </a> command also has a <code class="leafygreen-ui-1l06pbn"> c </code> field to define a list of variables. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Support for Username to LDAP DN Mapping by Default <a class="headerlink leafygreen-ui-1kepx47" href="#support-for-username-to-ldap-dn-mapping-by-default" 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="support-for-username-to-ldap-dn-mapping-by-default"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.userToDNMapping"> <code class="leafygreen-ui-1l06pbn"> userToDNMapping </code> </a> configuration file option and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--ldapUserToDNMapping"> <code class="leafygreen-ui-1l06pbn"> --ldapUserToDNMapping </code> </a> command line option for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> / <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongoldap/#std-program-mongoldap"> <code class="leafygreen-ui-1l06pbn"> mongoldap </code> </a> now map the authenticated username as the LDAP DN by default if an empty mapping document (i.e. an empty string or empty array) is specified to the option. Previously, providing an empty mapping document would cause mapping to fail. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Additional <code class="leafygreen-ui-1l06pbn"> dbStats </code> Free Space Statistics <a class="headerlink leafygreen-ui-1kepx47" href="#additional-dbstats-free-space-statistics" 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="additional-dbstats-free-space-statistics"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dbStats/#mongodb-dbcommand-dbcmd.dbStats"> <code class="leafygreen-ui-1l06pbn"> dbStats </code> </a> command outputs these additional statistics: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Free space allocated to collections ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dbStats/#mongodb-data-dbStats.freeStorageSize"> <code class="leafygreen-ui-1l06pbn"> freeStorageSize </code> ) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Free space allocated to indexes ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dbStats/#mongodb-data-dbStats.indexFreeStorageSize"> <code class="leafygreen-ui-1l06pbn"> indexFreeStorageSize </code> ) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Total free space allocated to collections and indexes ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dbStats/#mongodb-data-dbStats.totalFreeStorageSize"> <code class="leafygreen-ui-1l06pbn"> totalFreeStorageSize </code> ) </a> </p> </li> </ul> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> serverStatus </code> Output Change <a class="headerlink leafygreen-ui-1kepx47" href="#serverstatus-output-change" 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="serverstatus-output-change"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-dbcommand-dbcmd.serverStatus"> <code class="leafygreen-ui-1l06pbn"> serverStatus </code> </a> includes the following new fields in its output: </p> <dl> <dt> Aggregation Metrics </dt> <dd class="css-1ufxuu7"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.metrics.commands.update.pipeline"> <code class="leafygreen-ui-1l06pbn"> metrics.commands.update.pipeline </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.metrics.commands.update.arrayFilters"> <code class="leafygreen-ui-1l06pbn"> metrics.commands.update.arrayFilters </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.metrics.commands.findAndModify.pipeline"> <code class="leafygreen-ui-1l06pbn"> metrics.commands.findAndModify.pipeline </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.metrics.commands.findAndModify.arrayFilters"> <code class="leafygreen-ui-1l06pbn"> metrics.commands.findAndModify.arrayFilters </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.metrics.dotsAndDollarsFields"> <code class="leafygreen-ui-1l06pbn"> metrics.dotsAndDollarsFields </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.metrics.operatorCounters"> <code class="leafygreen-ui-1l06pbn"> metrics.operatorCounters </code> </a> </p> </li> </ul> </dd> <dt> API Version Metrics </dt> <dd class="css-1ufxuu7"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.metrics.apiVersions"> <code class="leafygreen-ui-1l06pbn"> metrics.apiVersions </code> </a> </p> </li> </ul> </dd> <dt> Replication Metrics </dt> <dd class="css-1ufxuu7"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.metrics.repl.reconfig.numAutoReconfigsForRemovalOfNewlyAddedFields"> <code class="leafygreen-ui-1l06pbn"> metrics.repl.reconfig.numAutoReconfigsForRemovalOfNewlyAddedFields </code> </a> </p> </li> </ul> </dd> <dt> Read Concern Counters </dt> <dd class="css-1ufxuu7"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.readConcernCounters"> <code class="leafygreen-ui-1l06pbn"> readConcernCounters </code> </a> , which reports on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern/#std-label-read-concern-levels"> read concern level </a> specified by query operations ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.readConcernCounters"> <code class="leafygreen-ui-1l06pbn"> readConcernCounters </code> </a> replaces <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.opReadConcernCounters"> <code class="leafygreen-ui-1l06pbn"> opReadConcernCounters </code> ) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.readConcernCounters"> <code class="leafygreen-ui-1l06pbn"> readConcernCounters </code> </a> now has the following new fields: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> readConcernCounters.nonTransactionOps.noneInfo </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> readConcernCounters.transactionOps.noneInfo </code> </p> </li> </ul> </li> </ul> </dd> <dt> Write Concern Counters </dt> <dd class="css-1ufxuu7"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.opWriteConcernCounters"> <code class="leafygreen-ui-1l06pbn"> opWriteConcernCounters </code> </a> now has the following new fields: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> opWriteConcernCounters.insert.noneInfo </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> opWriteConcernCounters.update.noneInfo </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> opWriteConcernCounters.delete.noneInfo </code> </p> </li> </ul> </li> </ul> </dd> <dt> Number of Threaded Connections </dt> <dd class="css-1ufxuu7"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.connections.threaded"> <code class="leafygreen-ui-1l06pbn"> connections.threaded </code> </a> , which reports the number of incoming connections from clients that are assigned to threads that service client requests </p> </li> </ul> </dd> <dt> Resharding Statistics </dt> <dd class="css-1ufxuu7"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.shardingStatistics.resharding"> <code class="leafygreen-ui-1l06pbn"> shardingStatistics.resharding </code> </a> , which reports statistics about resharding operations </p> </li> </ul> </dd> <dt> Service Executor Metrics </dt> <dd class="css-1ufxuu7"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.network.serviceExecutors"> <code class="leafygreen-ui-1l06pbn"> network.serviceExecutors </code> </a> , which reports on the service executors that run operations for client requests </p> </li> </ul> </dd> <dt> Cursor Metrics </dt> <dd class="css-1ufxuu7"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.metrics.cursor.moreThanOneBatch"> <code class="leafygreen-ui-1l06pbn"> metrics.cursor.moreThanOneBatch </code> </a> , which reports the total number of cursors that have returned more than one batch (additional batches are retrieved using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getMore/#mongodb-dbcommand-dbcmd.getMore"> <code class="leafygreen-ui-1l06pbn"> getMore </code> </a> command) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.metrics.cursor.totalOpened"> <code class="leafygreen-ui-1l06pbn"> metrics.cursor.totalOpened </code> </a> , which reports the total number of cursors that have been opened </p> </li> </ul> </dd> <dt> Security Counter </dt> <dd class="css-1ufxuu7"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.security.authentication.saslSupportedMechsReceived"> <code class="leafygreen-ui-1l06pbn"> security.authentication.saslSupportedMechsReceived </code> </a> , which reports the number of times a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hello/#mongodb-dbcommand-dbcmd.hello"> <code class="leafygreen-ui-1l06pbn"> hello </code> </a> request includes a valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hello/#mongodb-data-hello.saslSupportedMechs"> <code class="leafygreen-ui-1l06pbn"> hello.saslSupportedMechs </code> </a> field. </p> </li> </ul> </dd> <dt> Repl </dt> <dd class="css-1ufxuu7"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.repl"> <code class="leafygreen-ui-1l06pbn"> repl </code> </a> now includes a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.repl.primaryOnlyServices"> <code class="leafygreen-ui-1l06pbn"> primaryOnlyServices </code> </a> document that contains additional information about services that only run on replica set primaries. </p> </li> </ul> </dd> </dl> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Plan Cache Debug Info Size Limit <a class="headerlink leafygreen-ui-1kepx47" href="#plan-cache-debug-info-size-limit" 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="plan-cache-debug-info-size-limit"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-plans/#std-label-query-plans-query-optimization"> plan cache </a> will save full <code class="leafygreen-ui-1l06pbn"> plan cache </code> entries only if the cumulative size of the <code class="leafygreen-ui-1l06pbn"> plan caches </code> for all collections is lower than 0.5 GB. When the cumulative size of the <code class="leafygreen-ui-1l06pbn"> plan caches </code> for all collections exceeds this threshold, additional <code class="leafygreen-ui-1l06pbn"> plan cache </code> entries are stored without certain debug information. </p> <p class="leafygreen-ui-1kp3ins"> The estimated size in bytes of a <code class="leafygreen-ui-1l06pbn"> plan cache </code> entry is available in the output of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/planCacheStats/#mongodb-pipeline-pipe.-planCacheStats"> <code class="leafygreen-ui-1l06pbn"> $planCacheStats </code> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Closure of Inactive Cursors Opened Within a Session <a class="headerlink leafygreen-ui-1kepx47" href="#closure-of-inactive-cursors-opened-within-a-session" 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="closure-of-inactive-cursors-opened-within-a-session"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, cursors created within a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-isolation-consistency-recency/#std-label-read-isolation-consistency-recency"> client session </a> close when the corresponding <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/server-sessions/#std-label-server-sessions"> server session </a> ends with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/killSessions/#mongodb-dbcommand-dbcmd.killSessions"> <code class="leafygreen-ui-1l06pbn"> killSessions </code> </a> command, if the session times out, or if the client has exhausted the cursor. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/iterate-a-cursor/#std-label-read-operations-cursors"> Iterate a Cursor in <code class="leafygreen-ui-1l06pbn"> mongosh </code> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> New <code class="leafygreen-ui-1l06pbn"> validateDBMetadata </code> Command <a class="headerlink leafygreen-ui-1kepx47" href="#new-validatedbmetadata-command" 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="new-validatedbmetadata-command"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 adds the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/validateDBMetadata/#mongodb-dbcommand-dbcmd.validateDBMetadata"> <code class="leafygreen-ui-1l06pbn"> validateDBMetadata </code> </a> command. The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/validateDBMetadata/#mongodb-dbcommand-dbcmd.validateDBMetadata"> <code class="leafygreen-ui-1l06pbn"> validateDBMetadata </code> </a> command checks that the stored metadata of a database or a collection is valid within a particular API version. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-performance"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Performance Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#performance-considerations" 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="performance-considerations"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Implicit Default Write Concern <a class="headerlink leafygreen-ui-1kepx47" href="#implicit-default-write-concern-1" 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="implicit-default-write-concern-1"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 changes the default <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern"> write concern </a> to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> { w: "majority" } </code> </a> . The new default write concern might impact performance since MongoDB acknowledges writes only after a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-calculating-majority-count"> calculated majority </a> of replica set members have executed and persisted the write to disk. </p> <p class="leafygreen-ui-1kp3ins"> If your application relies on performance-sensitive writes, you can override the default write concern at the cost of data durability guarantees. To override this setting, you can: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Set the write concern at the individual operation level for performance-critical writes. For more information, see your <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> driver documentation <!-- --> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setDefaultRWConcern/#mongodb-dbcommand-dbcmd.setDefaultRWConcern"> <code class="leafygreen-ui-1l06pbn"> setDefaultRWConcern </code> </a> command to explicitly set the default write concern. </p> </li> </ul> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If write operations use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-number-"> <code class="leafygreen-ui-1l06pbn"> { w: 1 } </code> </a> write concern, the rollback directory may exclude writes submitted after an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog-hole"> oplog hole </a> if the primary restarts before the write operation completes. </p> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> local </code> Default Read Concern <a class="headerlink leafygreen-ui-1kepx47" href="#local-default-read-concern" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="local-default-read-concern"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-local/#mongodb-readconcern-readconcern.-local-"> <code class="leafygreen-ui-1l06pbn"> "local" </code> </a> is the default read concern level for read operations against the primary and secondaries. </p> <p class="leafygreen-ui-1kp3ins"> This may introduce a significant latency increase for count queries that use a filter and for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-optimization/#std-label-covered-queries"> covered queries <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> You can opt out of this behavior by setting the cluster-wide <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern/#std-label-read-concern"> read concern </a> with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setDefaultRWConcern/#mongodb-dbcommand-dbcmd.setDefaultRWConcern"> <code class="leafygreen-ui-1l06pbn"> setDefaultRWConcern </code> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Snapshot History Retention <a class="headerlink leafygreen-ui-1kepx47" href="#snapshot-history-retention" 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="snapshot-history-retention"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 increases the default value of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.minSnapshotHistoryWindowInSeconds"> <code class="leafygreen-ui-1l06pbn"> minSnapshotHistoryWindowInSeconds </code> </a> to <code class="leafygreen-ui-1l06pbn"> 300 </code> , which might negatively impact performance. If you aren't using read concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-snapshot/#mongodb-readconcern-readconcern.-snapshot-"> <code class="leafygreen-ui-1l06pbn"> "snapshot" </code> </a> , you can reduce the value of the <code class="leafygreen-ui-1l06pbn"> minSnapshotHistoryWindowInSeconds </code> parameter to <code class="leafygreen-ui-1l06pbn"> 5 </code> on all <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances. For more information, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/wiredtiger/#std-label-storage-snapshot-history"> Snapshot History Retention <!-- --> . </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"> If you are running a sharded cluster, do not change <code class="leafygreen-ui-1l06pbn"> minSnapshotHistoryWindowInSeconds </code> on <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-config-servers/#std-label-sharding-config-server"> config servers <!-- --> . </a> </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-platforms"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Platform Support <a class="headerlink leafygreen-ui-1kepx47" href="#platform-support" 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="platform-support"> </div> </a> </h2> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-rel-notes-minimum-microarchitecture"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Minimum Microarchitecture <a class="headerlink leafygreen-ui-1kepx47" href="#minimum-microarchitecture" 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="minimum-microarchitecture"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 introduces the following minimum microarchitecture requirements: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:15%"/> <col style="width:85%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> CPU </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Minimum Supported Microarchitecture </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Intel <code class="leafygreen-ui-1l06pbn"> x86_64 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 requires one of: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Intel <em> Sandy Bridge </em> or later Core processor, or </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Intel <em> Tiger Lake </em> or later Celeron or Pentium processor. </p> </li> </ul> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> AMD <code class="leafygreen-ui-1l06pbn"> x86_64 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MongoDB 5.0 requires AMD <em> Bulldozer </em> or later. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ARM <code class="leafygreen-ui-1l06pbn"> arm64 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MongoDB 5.0 requires <em> ARMv8.2-A </em> or later. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB v5.0 is not supported on <code class="leafygreen-ui-1l06pbn"> x86_64 </code> or <code class="leafygreen-ui-1l06pbn"> arm64 </code> platforms that do not meet these minimum microarchitecture requirements. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/production-notes/#std-label-prod-notes-supported-platforms-x86_64"> x86_64 Platform Support </a> for more information. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Removed Platforms <a class="headerlink leafygreen-ui-1kepx47" href="#removed-platforms" 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="removed-platforms"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 removes support for the following platforms: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> macOS 10.13 </strong> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> SLES 12 </strong> on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/production-notes/#std-label-prod-notes-supported-platforms-s390x"> s390x </a> architecture </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> Ubuntu 18.04 </strong> on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/production-notes/#std-label-prod-notes-supported-platforms-PPC64LE"> PPC64LE </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/production-notes/#std-label-prod-notes-supported-platforms-s390x"> s390x </a> architectures </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/production-notes/#std-label-prod-notes-supported-platforms"> Platform Support </a> for the full list of platforms and architectures supported in MongoDB 5.0. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Changes Affecting Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#changes-affecting-compatibility" 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="changes-affecting-compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Some changes can affect compatibility and may require user actions. For a detailed list of compatibility changes, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-compatibility/"> Compatibility Changes in MongoDB 5.0 <!-- --> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-upgrade"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Upgrade Procedures <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-procedures" 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="upgrade-procedures"> </div> </a> </h2> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Feature Compatibility Version </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To upgrade to MongoDB 5.0 from a 4.4 deployment, the 4.4 deployment must have <code class="leafygreen-ui-1l06pbn"> featureCompatibilityVersion </code> set to <code class="leafygreen-ui-1l06pbn"> 4.4 </code> . To check the version: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )","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-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">getParameter</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">featureCompatibilityVersion</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To upgrade to MongoDB 5.0, refer to the upgrade instructions specific to your MongoDB deployment: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-upgrade-standalone/"> Upgrade a Standalone to 5.0 </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-upgrade-replica-set/"> Upgrade a Replica Set to 5.0 </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0-upgrade-sharded-cluster/"> Upgrade a Sharded Cluster to 5.0 </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If you need guidance on upgrading to 5.0, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/products/consulting?tck=docs_server" target="_self"> <span> MongoDB professional services </span> </a> offer major version upgrade support to help ensure a smooth transition without interruption to your MongoDB application. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-downgrade-considerations"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Downgrade Consideration <a class="headerlink leafygreen-ui-1kepx47" href="#downgrade-consideration" 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="downgrade-consideration"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> MongoDB only supports single-version downgrades. You cannot downgrade to a release that is multiple versions behind your current release. </p> <p class="leafygreen-ui-1kp3ins"> For example, you may downgrade a <!-- --> 5.0-series <!-- --> to a <!-- --> 4.4-series <!-- --> deployment. However, further downgrading that <!-- --> 4.4-series <!-- --> deployment to a <!-- --> 4.2-series <!-- --> deployment is not supported. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-download"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Download <a class="headerlink leafygreen-ui-1kepx47" href="#download" 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="download"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To download MongoDB 5.0, go to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/try/download?tck=docs_server" target="_self"> <span> MongoDB Download Center </span> </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"> <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://github.com/mongodb/mongo/blob/v4.4/distsrc/THIRD-PARTY-NOTICES" rel="noopener noreferrer"> <span> All Third Party License Notices </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> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-known-issues"> </span> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-known-issue-granularity"> </span> <span class="leafygreen-ui-1qnjd6d" id="std-label-5.0-known-issue-backup-resharding"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Known Issues <a class="headerlink leafygreen-ui-1kepx47" href="#known-issues" 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="known-issues"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:15%"/> <col style="width:70%"/> <col style="width:20%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> In Version </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Issues </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Status </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5.0.0 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-58171" rel="noopener noreferrer"> <span> SERVER-58171 </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 Time Series collection's <code class="leafygreen-ui-1l06pbn"> granularity </code> parameter cannot be modified after the collection is created. </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Fixed in 5.0.1 </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5.0.0 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://jira.mongodb.org/browse/SERVER-58392" rel="noopener noreferrer"> <span> SERVER-58392 </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> : An ongoing resharding operation may prevent a backup or restore operation from succeeding. </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Fixed in 5.0.3 </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Report an Issue <a class="headerlink leafygreen-ui-1kepx47" href="#report-an-issue" 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="report-an-issue"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To report an issue, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://github.com/mongodb/mongo/wiki/Submit-Bug-Reports" rel="noopener noreferrer"> <span> MongoDB GitHub repository </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> for instructions on how to file a JIRA ticket for the MongoDB server or one of the related projects. </p> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/query-arrays/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Query an Array <a class="headerlink leafygreen-ui-1kepx47" href="#query-an-array" 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="query-an-array"> </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="#match-an-array" target="_self"> <span> Match an Array </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#query-an-array-for-an-element" target="_self"> <span> Query an Array for an Element </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#specify-multiple-conditions-for-array-elements" target="_self"> <span> Specify Multiple Conditions for Array Elements </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#query-an-array-with-mongodb-atlas" target="_self"> <span> Query an Array with MongoDB Atlas </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#additional-query-tutorials" target="_self"> <span> Additional Query Tutorials </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> You can query arrays in MongoDB using the following methods: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your programming language's driver. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/" target="_self"> <span> MongoDB Atlas UI </span> </a> . To learn more, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-query-array-atlas-ui" target="_self"> <span> Query an Array with MongoDB Atlas </span> </a> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/compass/current/" target="_self"> <span> MongoDB Compass <!-- --> . </span> </a> </p> </li> </ul> <hr class="css-1unva0n e4ru7ww0"/> <p class="leafygreen-ui-1kp3ins"> ➤ <!-- --> Use the <strong> Select your language </strong> drop-down menu in the upper-right to set the language of the following examples or select MongoDB Compass. </p> <hr class="css-1unva0n e4ru7ww0"/> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-4"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_hrinqr5ed" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_y9ylmpl9s" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_ikcrzotvy" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_rg2v4cs6v" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_erjuhxp32" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_mm9mclxth" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_6g488royh" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_dyg7uhelg" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_dsquqkto2" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_qzaza4co6" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_mqou36qlo" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_mqp3t781u" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_8m0xkm1el" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ohcj89gw5" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_d64s05ezj" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_r3z5dh8jm" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_qkbp254em" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_enyic515g" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_45vmf17mf" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_fuowyrnf5" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_hq8fl42iq" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_8g4yzuze2" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_hu7fr5vdk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5njdso9gi" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_1o3snzsm9" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_59ucc52bd" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_d2w4y58uk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ln862nttf" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_ophfz9nr4" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_g2ma4g8dx" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_uea898jhv" class="leafygreen-ui-38lglc" id="_auu814nz3" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> db.collection.find() </code> </a> method 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 examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_fc4naw2fh" class="leafygreen-ui-38lglc" id="_860a5wccm" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/compass/current/#std-label-compass-index" target="_self"> <span> MongoDB Compass <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_xgdc4qy8l" class="leafygreen-ui-38lglc" id="_k2zxf6wap" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongoc.org/libmongoc/current/mongoc_collection_find_with_opts.html" rel="noopener noreferrer"> <span> mongoc_collection_find_with_opts <!-- --> . </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_dj94t3fac" class="leafygreen-ui-38lglc" id="_iib2sy7e8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/M_MongoDB_Driver_MongoCollection_1_Find.htm" rel="noopener noreferrer"> <span> MongoCollection.Find() </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> method in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/" rel="noopener noreferrer"> <span> MongoDB C# Driver </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_jqdxslg99" class="leafygreen-ui-38lglc" id="_332o6gu5x" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://godoc.org/github.com/mongodb/mongo-go-driver/mongo#Collection.Find" rel="noopener noreferrer"> <span> Collection.Find </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> function in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://github.com/mongodb/mongo-go-driver/" rel="noopener noreferrer"> <span> MongoDB Go Driver </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_4opoknaa4" class="leafygreen-ui-38lglc" id="_hwq6ljk0l" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver-reactivestreams/1.6/javadoc/com/mongodb/reactivestreams/client/MongoCollection.html#find()" rel="noopener noreferrer"> <span> com.mongodb.reactivestreams.client.MongoCollection.find </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> method in the MongoDB <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver-reactivestreams/1.6/" rel="noopener noreferrer"> <span> Java Reactive Streams Driver </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_9399y3ygc" class="leafygreen-ui-38lglc" id="_u7kkoj4hg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/MongoCollection.html#find--" rel="noopener noreferrer"> <span> com.mongodb.client.MongoCollection.find </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> method in the MongoDB <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver/3.4/driver/" rel="noopener noreferrer"> <span> Java Synchronous Driver <!-- --> . </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The driver provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/model/Filters.html" rel="noopener noreferrer"> <span> com.mongodb.client.model.Filters </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> helper methods to facilitate the creation of filter documents. The examples on this page use these methods to create the filter documents. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_l42qm9hbu" class="leafygreen-ui-38lglc" id="_fnnh27s49" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> by using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find.html" rel="noopener noreferrer"> <span> MongoCollection.find() </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> method in the MongoDB <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/kotlin/coroutine/current/" target="_self"> <span> Kotlin Coroutine Driver <!-- --> . </span> </a> </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The driver provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html" rel="noopener noreferrer"> <span> com.mongodb.client.model.Filters </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> helper methods to facilitate the creation of filter documents. The examples on this page use these methods to create the filter documents. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_th61cehp1" class="leafygreen-ui-38lglc" id="_exx7v1mvz" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_collection.html#motor.motor_asyncio.AsyncIOMotorCollection.find" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> motor.motor_asyncio.AsyncIOMotorCollection.find </code> </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> method in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://motor.readthedocs.io/en/stable/" rel="noopener noreferrer"> <span> Motor </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> driver. </p> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_gffz64stn" class="" id="_wx8uozv4v" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#find" rel="noopener noreferrer"> <span> Collection.find() </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> method in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/node-mongodb-native/3.6/" rel="noopener noreferrer"> <span> MongoDB Node.js Driver <!-- --> . </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_d3r46378c" class="leafygreen-ui-38lglc" id="_2wp25j3u7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://metacpan.org/pod/MongoDB::Collection#find" rel="noopener noreferrer"> <span> MongoDB::Collection::find() </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> method in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://metacpan.org/release/MongoDB" rel="noopener noreferrer"> <span> MongoDB Perl Driver </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_qmarae9d0" class="leafygreen-ui-38lglc" id="_a2eka50ww" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/php-library/upcoming/reference/method/MongoDBCollection-find/#mongodb-phpmethod-phpmethod.MongoDB-Collection--find--" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> MongoDB\\Collection::find() </code> </span> </a> method in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/php-libraries/" target="_self"> <span> MongoDB PHP Library </span> </a> . </p> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_84pjmr2yy" class="leafygreen-ui-38lglc" id="_6jnp5zz4k" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.find" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> pymongo.collection.Collection.find </code> </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> method in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/languages/python/pymongo-driver/current/" target="_self"> <span> PyMongo </span> </a> Python driver. </p> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_00ylwpwjb" class="leafygreen-ui-38lglc" id="_0hcs1unzj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://api.mongodb.com/ruby/current/Mongo/Collection.html#find-instance_method" target="_self"> <span> Mongo::Collection#find() </span> </a> method in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/ruby-driver/current/" target="_self"> <span> MongoDB Ruby Driver <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_sjhhhtgyo" class="leafygreen-ui-38lglc" id="_fb7odhss2" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page provides examples of <!-- --> query operations on array fields <!-- --> using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-scala-driver/2.9/scaladoc/org/mongodb/scala/MongoCollection.html#find[C](filter:org.mongodb.scala.bson.conversions.Bson)(implicite:org.mongodb.scala.bson.DefaultHelper.DefaultsTo[C,TResult],implicitct:scala.reflect.ClassTag[C]):org.mongodb.scala.FindObservable[C]" rel="noopener noreferrer"> <span> collection.find() </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> method in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-scala-driver/" rel="noopener noreferrer"> <span> MongoDB Scala Driver </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-5"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_z4d1npo29" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_86cjbo1iy" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_3718osmui" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_soc8q1rhw" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_w4lmuf9cp" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_64uw7e3yk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_kr58ssxy2" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_laockd7w6" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_6zwd9gpd4" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_zcg918dxa" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_n1zft9rb7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_zzatajn8w" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_xbvk6yecn" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_v5944yro6" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_qt53yo8m1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_yaspi2mgt" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_v740lfmy7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_sdcvbsxdh" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_z6uewi0u1" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_8cnqolqla" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_o11vdqaeu" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_c0byolrk2" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_jhvxc6mi7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fom4wxlp6" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_rtkxtifc1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_bssl7rl1l" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_2htc5q7lv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_hb55ischc" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_l2204faby" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_dj08q82i1" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_18jwpx9je" class="leafygreen-ui-38lglc" id="_idnsw01s8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.insertMany([\n { item: \"journal\", qty: 25, tags: [\"blank\", \"red\"], dim_cm: [ 14, 21 ] },\n { item: \"notebook\", qty: 50, tags: [\"red\", \"blank\"], dim_cm: [ 14, 21 ] },\n { item: \"paper\", qty: 100, tags: [\"red\", \"blank\", \"plain\"], dim_cm: [ 14, 21 ] },\n { item: \"planner\", qty: 75, tags: [\"blank\", \"red\"], dim_cm: [ 22.85, 30 ] },\n { item: \"postcard\", qty: 45, tags: [\"blue\"], dim_cm: [ 10, 15.25 ] }\n]);","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"journal"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">25</span>, <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span>]<!-- -->, <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[ <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"notebook"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">50</span>, <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>]<!-- -->, <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[ <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"paper"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">100</span>, <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"plain"</span>]<!-- -->, <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[ <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"planner"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">75</span>, <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span>]<!-- -->, <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[ <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-number">30</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"postcard"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">45</span>, <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">"blue"</span>]<!-- -->, <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[ <span class="lg-highlight-number">10</span>, <span class="lg-highlight-number">15.25</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-34-menu" aria-describedby="select-34-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-35" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ris:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ris:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ris:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ris:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_ss3i6dmg2" class="leafygreen-ui-38lglc" id="_tkfjy5gly" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n { \"item\": \"journal\", \"qty\": 25, \"tags\": [\"blank\", \"red\"], \"dim_cm\": [ 14, 21 ] },\n { \"item\": \"notebook\", \"qty\": 50, \"tags\": [\"red\", \"blank\"], \"dim_cm\": [ 14, 21 ] },\n { \"item\": \"paper\", \"qty\": 100, \"tags\": [\"red\", \"blank\", \"plain\"], \"dim_cm\": [ 14, 21 ] },\n { \"item\": \"planner\", \"qty\": 75, \"tags\": [\"blank\", \"red\"], \"dim_cm\": [ 22.85, 30 ] },\n { \"item\": \"postcard\", \"qty\": 45, \"tags\": [\"blue\"], \"dim_cm\": [ 10, 15.25 ] }\n]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"journal"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">25</span>, <span class="lg-highlight-string">"tags"</span>: <!-- -->[<span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span>]<!-- -->, <span class="lg-highlight-string">"dim_cm"</span>: <!-- -->[ <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"notebook"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">50</span>, <span class="lg-highlight-string">"tags"</span>: <!-- -->[<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>]<!-- -->, <span class="lg-highlight-string">"dim_cm"</span>: <!-- -->[ <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"paper"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">100</span>, <span class="lg-highlight-string">"tags"</span>: <!-- -->[<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"plain"</span>]<!-- -->, <span class="lg-highlight-string">"dim_cm"</span>: <!-- -->[ <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"planner"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">75</span>, <span class="lg-highlight-string">"tags"</span>: <!-- -->[<span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span>]<!-- -->, <span class="lg-highlight-string">"dim_cm"</span>: <!-- -->[ <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-number">30</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"postcard"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">45</span>, <span class="lg-highlight-string">"tags"</span>: <!-- -->[<span class="lg-highlight-string">"blue"</span>]<!-- -->, <span class="lg-highlight-string">"dim_cm"</span>: <!-- -->[ <span class="lg-highlight-number">10</span>, <span class="lg-highlight-number">15.25</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-37-menu" aria-describedby="select-37-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-38" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rit:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rit:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rit:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rit:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For instructions on inserting documents in MongoDB Compass, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/insert-documents/#std-label-write-op-insert"> Insert Documents <!-- --> . </a> </p> </div> </div> </div> <div> <div aria-labelledby="_fhhg82wkw" class="leafygreen-ui-38lglc" id="_kjiy5014g" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongoc_collection_t *collection;\nmongoc_bulk_operation_t *bulk;\nbson_t *doc;\nbool r;\nbson_error_t error;\nbson_t reply;\n\ncollection = mongoc_database_get_collection (db, \"inventory\");\nbulk = mongoc_collection_create_bulk_operation_with_opts (collection, NULL);\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"journal\"),\n \"qty\", BCON_INT64 (25),\n \"tags\", \"[\",\n BCON_UTF8 (\"blank\"), BCON_UTF8 (\"red\"),\n \"]\",\n \"dim_cm\", \"[\",\n BCON_INT64 (14), BCON_INT64 (21),\n \"]\");\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"notebook\"),\n \"qty\", BCON_INT64 (50),\n \"tags\", \"[\",\n BCON_UTF8 (\"red\"), BCON_UTF8 (\"blank\"),\n \"]\",\n \"dim_cm\", \"[\",\n BCON_INT64 (14), BCON_INT64 (21),\n \"]\");\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"paper\"),\n \"qty\", BCON_INT64 (100),\n \"tags\", \"[\",\n BCON_UTF8 (\"red\"), BCON_UTF8 (\"blank\"), BCON_UTF8 (\"plain\"),\n \"]\",\n \"dim_cm\", \"[\",\n BCON_INT64 (14), BCON_INT64 (21),\n \"]\");\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"planner\"),\n \"qty\", BCON_INT64 (75),\n \"tags\", \"[\",\n BCON_UTF8 (\"blank\"), BCON_UTF8 (\"red\"),\n \"]\",\n \"dim_cm\", \"[\",\n BCON_DOUBLE (22.85), BCON_INT64 (30),\n \"]\");\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"postcard\"),\n \"qty\", BCON_INT64 (45),\n \"tags\", \"[\",\n BCON_UTF8 (\"blue\"),\n \"]\",\n \"dim_cm\", \"[\",\n BCON_INT64 (10), BCON_DOUBLE (15.25),\n \"]\");\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\n/* \"reply\" is initialized on success or error */\nr = (bool) mongoc_bulk_operation_execute (bulk, &amp;reply, &amp;error);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n}","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongoc_collection_t *collection;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongoc_bulk_operation_t *bulk;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *doc;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bool r;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_error_t error;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t reply;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection <!-- -->= <!-- -->mongoc_database_get_collection (db<!-- -->, <span class="lg-highlight-string">"inventory"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bulk <!-- -->= <!-- -->mongoc_collection_create_bulk_operation_with_opts (collection<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"journal"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">25</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"["</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"blank"</span>)<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<span class="lg-highlight-string">"red"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"]"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-string">"["</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><!-- --><span class="lg-highlight-number">14</span>)<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<span class="lg-highlight-number">21</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"]"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"notebook"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">50</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"["</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"red"</span>)<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<span class="lg-highlight-string">"blank"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"]"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-string">"["</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><!-- --><span class="lg-highlight-number">14</span>)<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<span class="lg-highlight-number">21</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"]"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"paper"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">100</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"["</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"red"</span>)<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> <!-- -->(<span class="lg-highlight-string">"blank"</span>)<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<span class="lg-highlight-string">"plain"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"]"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-string">"["</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><!-- --><span class="lg-highlight-number">14</span>)<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<span class="lg-highlight-number">21</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"]"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"planner"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">75</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"["</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"blank"</span>)<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<span class="lg-highlight-string">"red"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"]"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-string">"["</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><!-- --><span class="lg-highlight-number">22.85</span>)<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<span class="lg-highlight-number">30</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"]"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"postcard"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">45</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"["</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"blue"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"]"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-string">"["</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><!-- --><span class="lg-highlight-number">10</span>)<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<span class="lg-highlight-number">15.25</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"]"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">/* "reply"</span><span class="lg-highlight-comment"> is initialized on </span><span class="lg-highlight-comment">success or error */</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->(bool) mongoc_bulk_operation_execute (<!-- -->bulk<!-- -->, <!-- -->&amp;reply, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-40-menu" aria-describedby="select-40-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-41" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:riu:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":riu:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":riu:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":riu:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_hkbv2fqzl" class="leafygreen-ui-38lglc" id="_fq0dzonjo" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var documents = new[]\n{\n new BsonDocument\n {\n { \"item\", \"journal\" },\n { \"qty\", 25 },\n { \"tags\", new BsonArray { \"blank\", \"red\" } },\n { \"dim_cm\", new BsonArray { 14, 21 } }\n },\n new BsonDocument\n {\n { \"item\", \"notebook\" },\n { \"qty\", 50 },\n { \"tags\", new BsonArray { \"red\", \"blank\" } },\n { \"dim_cm\", new BsonArray { 14, 21 } }\n },\n new BsonDocument\n {\n { \"item\", \"paper\" },\n { \"qty\", 100 },\n { \"tags\", new BsonArray { \"red\", \"blank\", \"plain\" } },\n { \"dim_cm\", new BsonArray { 14, 21 } }\n },\n new BsonDocument\n {\n { \"item\", \"planner\" },\n { \"qty\", 75 },\n { \"tags\", new BsonArray { \"blank\", \"red\" } },\n { \"dim_cm\", new BsonArray { 22.85, 30 } }\n },\n new BsonDocument\n {\n { \"item\", \"postcard\" },\n { \"qty\", 45 },\n { \"tags\", new BsonArray { \"blue\" } },\n { \"dim_cm\", new BsonArray { 10, 15.25 } }\n }\n};\ncollection.InsertMany(documents);","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> documents = <span class="lg-highlight-keyword">new</span>[]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"journal"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">25</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonArray</span> { <span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span> } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonArray</span> { <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"notebook"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">50</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonArray</span> { <span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span> } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonArray</span> { <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">100</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonArray</span> { <span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"plain"</span> } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonArray</span> { <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"planner"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">75</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonArray</span> { <span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span> } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonArray</span> { <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-number">30</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"postcard"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">45</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonArray</span> { <span class="lg-highlight-string">"blue"</span> } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonArray</span> { <span class="lg-highlight-number">10</span>, <span class="lg-highlight-number">15.25</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">};</td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-class">InsertMany</span>(documents);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-43-menu" aria-describedby="select-43-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-44" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:riv:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":riv:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":riv:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":riv:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_2fbo1p0mj" class="leafygreen-ui-38lglc" id="_w322su062" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\ndocs := []interface{}{\n\tbson.D{\n\t\t{\"item\", \"journal\"},\n\t\t{\"qty\", 25},\n\t\t{\"tags\", bson.A{\"blank\", \"red\"}},\n\t\t{\"dim_cm\", bson.A{14, 21}},\n\t},\n\tbson.D{\n\t\t{\"item\", \"notebook\"},\n\t\t{\"qty\", 50},\n\t\t{\"tags\", bson.A{\"red\", \"blank\"}},\n\t\t{\"dim_cm\", bson.A{14, 21}},\n\t},\n\tbson.D{\n\t\t{\"item\", \"paper\"},\n\t\t{\"qty\", 100},\n\t\t{\"tags\", bson.A{\"red\", \"blank\", \"plain\"}},\n\t\t{\"dim_cm\", bson.A{14, 21}},\n\t},\n\tbson.D{\n\t\t{\"item\", \"planner\"},\n\t\t{\"qty\", 75},\n\t\t{\"tags\", bson.A{\"blank\", \"red\"}},\n\t\t{\"dim_cm\", bson.A{22.85, 30}},\n\t},\n\tbson.D{\n\t\t{\"item\", \"postcard\"},\n\t\t{\"qty\", 45},\n\t\t{\"tags\", bson.A{\"blue\"}},\n\t\t{\"dim_cm\", bson.A{10, 15.25}},\n\t},\n}\n\nresult, err := coll.InsertMany(context.TODO(), docs)\n","programmingLanguage":"Golang"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">docs <!-- -->:<!-- -->= []interface{}{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"journal"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">25</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"tags"</span>, bson.<span class="lg-highlight-property">A</span>{<span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"dim_cm"</span>, bson.<span class="lg-highlight-property">A</span>{<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"notebook"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">50</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"tags"</span>, bson.<span class="lg-highlight-property">A</span>{<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"dim_cm"</span>, bson.<span class="lg-highlight-property">A</span>{<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">100</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"tags"</span>, bson.<span class="lg-highlight-property">A</span>{<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"plain"</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"dim_cm"</span>, bson.<span class="lg-highlight-property">A</span>{<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"planner"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">75</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"tags"</span>, bson.<span class="lg-highlight-property">A</span>{<span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"dim_cm"</span>, bson.<span class="lg-highlight-property">A</span>{<span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-number">30</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"postcard"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">45</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"tags"</span>, bson.<span class="lg-highlight-property">A</span>{<span class="lg-highlight-string">"blue"</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"dim_cm"</span>, bson.<span class="lg-highlight-property">A</span>{<span class="lg-highlight-number">10</span>, <span class="lg-highlight-number">15.25</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">result<!-- -->, <!-- -->err := coll.<span class="lg-highlight-title lg-highlight-class">InsertMany</span>(context.<span class="lg-highlight-title lg-highlight-function">TODO</span>(), docs)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-46-menu" aria-describedby="select-46-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-47" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rj0:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rj0:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj0:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj0:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_39juq2qt7" class="leafygreen-ui-38lglc" id="_e026s4x03" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"Publisher&lt;success&gt; insertManyPublisher = collection.insertMany(asList(\n Document.parse(\"{ item: 'journal', qty: 25, tags: ['blank', 'red'], dim_cm: [ 14, 21 ] }\"),\n Document.parse(\"{ item: 'notebook', qty: 50, tags: ['red', 'blank'], dim_cm: [ 14, 21 ] }\"),\n Document.parse(\"{ item: 'paper', qty: 100, tags: ['red', 'blank', 'plain'], dim_cm: [ 14, 21 ] }\"),\n Document.parse(\"{ item: 'planner', qty: 75, tags: ['blank', 'red'], dim_cm: [ 22.85, 30 ] }\"),\n Document.parse(\"{ item: 'postcard', qty: 45, tags: ['blue'], dim_cm: [ 10, 15.25 ] }\")\n));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">Publisher</span>&lt;<span class="lg-highlight-title lg-highlight-class">Success</span>&gt; insertManyPublisher = collection.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<span class="lg-highlight-title lg-highlight-function">asList</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'journal', qty: 25, tags: ['blank', 'red'], dim_cm: [ 14, 21 ] }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'notebook', qty: 50, tags: ['red', 'blank'], dim_cm: [ 14, 21 ] }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'paper', qty: 100, tags: ['red', 'blank', 'plain'], dim_cm: [ 14, 21 ] }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'planner', qty: 75, tags: ['blank', 'red'], dim_cm: [ 22.85, 30 ] }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'postcard', qty: 45, tags: ['blue'], dim_cm: [ 10, 15.25 ] }"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-49-menu" aria-describedby="select-49-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-50" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rj1:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rj1:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj1:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj1:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_6pvgzj6yj" class="leafygreen-ui-38lglc" id="_hlunpq7qu" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.insertMany(asList(\n Document.parse(\"{ item: 'journal', qty: 25, tags: ['blank', 'red'], dim_cm: [ 14, 21 ] }\"),\n Document.parse(\"{ item: 'notebook', qty: 50, tags: ['red', 'blank'], dim_cm: [ 14, 21 ] }\"),\n Document.parse(\"{ item: 'paper', qty: 100, tags: ['red', 'blank', 'plain'], dim_cm: [ 14, 21 ] }\"),\n Document.parse(\"{ item: 'planner', qty: 75, tags: ['blank', 'red'], dim_cm: [ 22.85, 30 ] }\"),\n Document.parse(\"{ item: 'postcard', qty: 45, tags: ['blue'], dim_cm: [ 10, 15.25 ] }\")\n));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<span class="lg-highlight-title lg-highlight-function">asList</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'journal', qty: 25, tags: ['blank', 'red'], dim_cm: [ 14, 21 ] }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'notebook', qty: 50, tags: ['red', 'blank'], dim_cm: [ 14, 21 ] }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'paper', qty: 100, tags: ['red', 'blank', 'plain'], dim_cm: [ 14, 21 ] }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'planner', qty: 75, tags: ['blank', 'red'], dim_cm: [ 22.85, 30 ] }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'postcard', qty: 45, tags: ['blue'], dim_cm: [ 10, 15.25 ] }"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-52-menu" aria-describedby="select-52-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-53" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rj2:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rj2:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj2:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj2:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_7utlf5hby" class="leafygreen-ui-38lglc" id="_spajk3e1v" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.insertMany(\n listOf(\n Document(\"item\", \"journal\")\n .append(\"qty\", 25)\n .append(\"tags\", listOf(\"blank\", \"red\"))\n .append(\"dim_cm\", listOf(14, 21)),\n Document(\"item\", \"notebook\")\n .append(\"qty\", 50)\n .append(\"tags\", listOf(\"red\", \"blank\"))\n .append(\"dim_cm\", listOf(14, 21)),\n Document(\"item\", \"paper\")\n .append(\"qty\", 100)\n .append(\"tags\", listOf(\"red\", \"blank\", \"plain\"))\n .append(\"dim_cm\", listOf(14, 21)),\n Document(\"item\", \"planner\")\n .append(\"qty\", 75)\n .append(\"tags\", listOf(\"blank\", \"red\"))\n .append(\"dim_cm\", listOf(22.85, 30)),\n Document(\"item\", \"postcard\")\n .append(\"qty\", 45)\n .append(\"tags\", listOf(\"blue\"))\n .append(\"dim_cm\", listOf(10, 15.25)),\n )\n)","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-function">listOf</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"journal"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">25</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-title lg-highlight-function">listOf</span>(<span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-title lg-highlight-function">listOf</span>(<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>)),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"notebook"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">50</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-title lg-highlight-function">listOf</span>(<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-title lg-highlight-function">listOf</span>(<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>)),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">100</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-title lg-highlight-function">listOf</span>(<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"plain"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-title lg-highlight-function">listOf</span>(<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>)),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"planner"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">75</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-title lg-highlight-function">listOf</span>(<span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-title lg-highlight-function">listOf</span>(<span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-number">30</span>)),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"postcard"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">45</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-title lg-highlight-function">listOf</span>(<span class="lg-highlight-string">"blue"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-title lg-highlight-function">listOf</span>(<span class="lg-highlight-number">10</span>, <span class="lg-highlight-number">15.25</span>)),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-55-menu" aria-describedby="select-55-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-56" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rj3:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rj3:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj3:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj3:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_nfcraxwmw" class="leafygreen-ui-38lglc" id="_wpda9hyic" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"await db.inventory.insert_many(\n [\n {\"item\": \"journal\", \"qty\": 25, \"tags\": [\"blank\", \"red\"], \"dim_cm\": [14, 21]},\n {\"item\": \"notebook\", \"qty\": 50, \"tags\": [\"red\", \"blank\"], \"dim_cm\": [14, 21]},\n {\n \"item\": \"paper\",\n \"qty\": 100,\n \"tags\": [\"red\", \"blank\", \"plain\"],\n \"dim_cm\": [14, 21],\n },\n {\"item\": \"planner\", \"qty\": 75, \"tags\": [\"blank\", \"red\"], \"dim_cm\": [22.85, 30]},\n {\"item\": \"postcard\", \"qty\": 45, \"tags\": [\"blue\"], \"dim_cm\": [10, 15.25]},\n ]\n)","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">await</span> db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">insert_many</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"journal"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">25</span>, <span class="lg-highlight-string">"tags"</span>: [<span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span>], <span class="lg-highlight-string">"dim_cm"</span>: [<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>]},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"notebook"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">50</span>, <span class="lg-highlight-string">"tags"</span>: [<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>], <span class="lg-highlight-string">"dim_cm"</span>: [<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>]},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"paper"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"tags"</span>: [<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"plain"</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dim_cm"</span>: [<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"planner"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">75</span>, <span class="lg-highlight-string">"tags"</span>: [<span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span>], <span class="lg-highlight-string">"dim_cm"</span>: [<span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-number">30</span>]},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"postcard"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">45</span>, <span class="lg-highlight-string">"tags"</span>: [<span class="lg-highlight-string">"blue"</span>], <span class="lg-highlight-string">"dim_cm"</span>: [<span class="lg-highlight-number">10</span>, <span class="lg-highlight-number">15.25</span>]},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-58-menu" aria-describedby="select-58-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-59" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rj4:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rj4:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj4:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj4:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_wasmdqzd1" class="" id="_qnv2s1izm" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"await db.collection('inventory').insertMany([\n {\n item: 'journal',\n qty: 25,\n tags: ['blank', 'red'],\n dim_cm: [14, 21]\n },\n {\n item: 'notebook',\n qty: 50,\n tags: ['red', 'blank'],\n dim_cm: [14, 21]\n },\n {\n item: 'paper',\n qty: 100,\n tags: ['red', 'blank', 'plain'],\n dim_cm: [14, 21]\n },\n {\n item: 'planner',\n qty: 75,\n tags: ['blank', 'red'],\n dim_cm: [22.85, 30]\n },\n {\n item: 'postcard',\n qty: 45,\n tags: ['blue'],\n dim_cm: [10, 15.25]\n }\n]);","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">await</span> db.<span class="lg-highlight-title lg-highlight-function">collection</span>(<span class="lg-highlight-string">'inventory'</span>).<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'journal'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">'blank'</span>, <span class="lg-highlight-string">'red'</span>]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'notebook'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">50</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">'red'</span>, <span class="lg-highlight-string">'blank'</span>]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'paper'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">'red'</span>, <span class="lg-highlight-string">'blank'</span>, <span class="lg-highlight-string">'plain'</span>]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'planner'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">75</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">'blank'</span>, <span class="lg-highlight-string">'red'</span>]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[<span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-number">30</span>]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'postcard'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">45</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">'blue'</span>]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[<span class="lg-highlight-number">10</span>, <span class="lg-highlight-number">15.25</span>]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-61-menu" aria-describedby="select-61-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-62" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rj5:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rj5:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj5:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj5:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_6utmofqyg" class="leafygreen-ui-38lglc" id="_xdg5jaavu" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$db-&gt;coll(\"inventory\")-&gt;insert_many(\n [\n {\n item =&gt; \"journal\",\n qty =&gt; 25,\n tags =&gt; [ \"blank\", \"red\" ],\n dim_cm =&gt; [ 14, 21 ]\n },\n {\n item =&gt; \"notebook\",\n qty =&gt; 50,\n tags =&gt; [ \"red\", \"blank\" ],\n dim_cm =&gt; [ 14, 21 ]\n },\n {\n item =&gt; \"paper\",\n qty =&gt; 100,\n tags =&gt; [ \"red\", \"blank\", \"plain\" ],\n dim_cm =&gt; [ 14, 21 ]\n },\n {\n item =&gt; \"planner\",\n qty =&gt; 75,\n tags =&gt; [ \"blank\", \"red\" ],\n dim_cm =&gt; [ 22.85, 30 ]\n },\n {\n item =&gt; \"postcard\",\n qty =&gt; 45,\n tags =&gt; [\"blue\"],\n dim_cm =&gt; [ 10, 15.25 ]\n }\n ]\n);","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$db<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">coll</span>(<span class="lg-highlight-string">"inventory"</span>)<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">insert_many</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"journal"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">tags</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <!-- -->[ <span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">dim_cm</span><!-- --><span class="lg-highlight-function"> =&gt;</span> [ <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"notebook"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">50</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">tags</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <!-- -->[ <span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">dim_cm</span><!-- --><span class="lg-highlight-function"> =&gt;</span> [ <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"paper"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">tags</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <!-- -->[ <span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"plain"</span> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">dim_cm</span><!-- --><span class="lg-highlight-function"> =&gt;</span> [ <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"planner"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">75</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">tags</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <!-- -->[ <span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">dim_cm</span><!-- --><span class="lg-highlight-function"> =&gt;</span> [ <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-number">30</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"postcard"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">45</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">tags</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <!-- -->[<span class="lg-highlight-string">"blue"</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">dim_cm</span><!-- --><span class="lg-highlight-function"> =&gt;</span> [ <span class="lg-highlight-number">10</span>, <span class="lg-highlight-number">15.25</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-64-menu" aria-describedby="select-64-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-65" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rj6:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rj6:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj6:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj6:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_3qj97rrw4" class="leafygreen-ui-38lglc" id="_8knvv78f8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$insertManyResult = $db-&gt;inventory-&gt;insertMany([\n [\n 'item' =&gt; 'journal',\n 'qty' =&gt; 25,\n 'tags' =&gt; ['blank', 'red'],\n 'dim_cm' =&gt; [14, 21],\n ],\n [\n 'item' =&gt; 'notebook',\n 'qty' =&gt; 50,\n 'tags' =&gt; ['red', 'blank'],\n 'dim_cm' =&gt; [14, 21],\n ],\n [\n 'item' =&gt; 'paper',\n 'qty' =&gt; 100,\n 'tags' =&gt; ['red', 'blank', 'plain'],\n 'dim_cm' =&gt; [14, 21],\n ],\n [\n 'item' =&gt; 'planner',\n 'qty' =&gt; 75,\n 'tags' =&gt; ['blank', 'red'],\n 'dim_cm' =&gt; [22.85, 30],\n ],\n [\n 'item' =&gt; 'postcard',\n 'qty' =&gt; 45,\n 'tags' =&gt; ['blue'],\n 'dim_cm' =&gt; [10, 15.25],\n ],\n]);","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$insertManyResult = $db-&gt;inventory-&gt;<span class="lg-highlight-title lg-highlight-function">insertMany</span>([</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'journal'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'tags'</span> =&gt; [<span class="lg-highlight-string">'blank'</span>, <span class="lg-highlight-string">'red'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'dim_cm'</span> =&gt; [<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'notebook'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">50</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'tags'</span> =&gt; [<span class="lg-highlight-string">'red'</span>, <span class="lg-highlight-string">'blank'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'dim_cm'</span> =&gt; [<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'paper'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'tags'</span> =&gt; [<span class="lg-highlight-string">'red'</span>, <span class="lg-highlight-string">'blank'</span>, <span class="lg-highlight-string">'plain'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'dim_cm'</span> =&gt; [<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'planner'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">75</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'tags'</span> =&gt; [<span class="lg-highlight-string">'blank'</span>, <span class="lg-highlight-string">'red'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'dim_cm'</span> =&gt; [<span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-number">30</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'postcard'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">45</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'tags'</span> =&gt; [<span class="lg-highlight-string">'blue'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'dim_cm'</span> =&gt; [<span class="lg-highlight-number">10</span>, <span class="lg-highlight-number">15.25</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-67-menu" aria-describedby="select-67-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-68" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rj7:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rj7:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj7:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj7:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_c0usf00xq" class="leafygreen-ui-38lglc" id="_461iohptf" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.insert_many(\n [\n {\"item\": \"journal\", \"qty\": 25, \"tags\": [\"blank\", \"red\"], \"dim_cm\": [14, 21]},\n {\"item\": \"notebook\", \"qty\": 50, \"tags\": [\"red\", \"blank\"], \"dim_cm\": [14, 21]},\n {\n \"item\": \"paper\",\n \"qty\": 100,\n \"tags\": [\"red\", \"blank\", \"plain\"],\n \"dim_cm\": [14, 21],\n },\n {\"item\": \"planner\", \"qty\": 75, \"tags\": [\"blank\", \"red\"], \"dim_cm\": [22.85, 30]},\n {\"item\": \"postcard\", \"qty\": 45, \"tags\": [\"blue\"], \"dim_cm\": [10, 15.25]},\n ]\n)","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">insert_many</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"journal"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">25</span>, <span class="lg-highlight-string">"tags"</span>: [<span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span>], <span class="lg-highlight-string">"dim_cm"</span>: [<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>]},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"notebook"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">50</span>, <span class="lg-highlight-string">"tags"</span>: [<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>], <span class="lg-highlight-string">"dim_cm"</span>: [<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>]},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"paper"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"tags"</span>: [<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"plain"</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dim_cm"</span>: [<span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"planner"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">75</span>, <span class="lg-highlight-string">"tags"</span>: [<span class="lg-highlight-string">"blank"</span>, <span class="lg-highlight-string">"red"</span>], <span class="lg-highlight-string">"dim_cm"</span>: [<span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-number">30</span>]},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"postcard"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">45</span>, <span class="lg-highlight-string">"tags"</span>: [<span class="lg-highlight-string">"blue"</span>], <span class="lg-highlight-string">"dim_cm"</span>: [<span class="lg-highlight-number">10</span>, <span class="lg-highlight-number">15.25</span>]},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-70-menu" aria-describedby="select-70-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-71" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rj8:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rj8:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj8:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj8:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_4p4hwfpxd" class="leafygreen-ui-38lglc" id="_jf67xn4gu" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client[:inventory].insert_many([{ item: 'journal',\n qty: 25,\n tags: ['blank', 'red'],\n dim_cm: [ 14, 21 ] },\n { item: 'notebook',\n qty: 50,\n tags: ['red', 'blank'],\n dim_cm: [ 14, 21 ] },\n { item: 'paper',\n qty: 100,\n tags: ['red', 'blank', 'plain'],\n dim_cm: [ 14, 21 ] },\n { item: 'planner',\n qty: 75,\n tags: ['blank', 'red'],\n dim_cm: [ 22.85, 30 ] },\n { item: 'postcard',\n qty: 45,\n tags: ['blue'],\n dim_cm: [ 10, 15.25 ] }\n ])","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client<!-- -->[<!-- -->:inventory].<span class="lg-highlight-title lg-highlight-function">insert_many</span>(<!-- -->[<!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'journal'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">'blank'</span>, <span class="lg-highlight-string">'red'</span>]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[ <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'notebook'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">50</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">'red'</span>, <span class="lg-highlight-string">'blank'</span>]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[ <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'paper'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">'red'</span>, <span class="lg-highlight-string">'blank'</span>, <span class="lg-highlight-string">'plain'</span>]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[ <span class="lg-highlight-number">14</span>, <span class="lg-highlight-number">21</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'planner'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">75</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">'blank'</span>, <span class="lg-highlight-string">'red'</span>]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[ <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-number">30</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'postcard'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">45</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">'blue'</span>]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dim_cm</span>: <!-- -->[ <span class="lg-highlight-number">10</span>, <span class="lg-highlight-number">15.25</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-73-menu" aria-describedby="select-73-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-74" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rj9:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rj9:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj9:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rj9:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_d70r6maap" class="leafygreen-ui-38lglc" id="_3m5151efs" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.insertMany(Seq(\n Document(\"\"\"{ item: \"journal\", qty: 25, tags: [\"blank\", \"red\"], dim_cm: [ 14, 21 ] }\"\"\"),\n Document(\"\"\"{ item: \"notebook\", qty: 50, tags: [\"red\", \"blank\"], dim_cm: [ 14, 21 ] }\"\"\"),\n Document(\"\"\"{ item: \"paper\", qty: 100, tags: [\"red\", \"blank\", \"plain\"], dim_cm: [ 14, 21 ] }\"\"\"),\n Document(\"\"\"{ item: \"planner\", qty: 75, tags: [\"blank\", \"red\"], dim_cm: [ 22.85, 30 ] }\"\"\"),\n Document(\"\"\"{ item: \"postcard\", qty: 45, tags: [\"blue\"], dim_cm: [ 10, 15.25 ] }\"\"\")\n)).execute()","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<span class="lg-highlight-title lg-highlight-class">Seq</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>journal<span class="lg-highlight-string">", qty: 25, tags: ["</span>blank<span class="lg-highlight-string">", "</span>red<span class="lg-highlight-string">"], dim_cm: [ 14, 21 ] }"</span><span class="lg-highlight-string">""</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>notebook<span class="lg-highlight-string">", qty: 50, tags: ["</span>red<span class="lg-highlight-string">", "</span>blank<span class="lg-highlight-string">"], dim_cm: [ 14, 21 ] }"</span><span class="lg-highlight-string">""</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>paper<span class="lg-highlight-string">", qty: 100, tags: ["</span>red<span class="lg-highlight-string">", "</span>blank<span class="lg-highlight-string">", "</span>plain<span class="lg-highlight-string">"], dim_cm: [ 14, 21 ] }"</span><span class="lg-highlight-string">""</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>planner<span class="lg-highlight-string">", qty: 75, tags: ["</span>blank<span class="lg-highlight-string">", "</span>red<span class="lg-highlight-string">"], dim_cm: [ 22.85, 30 ] }"</span><span class="lg-highlight-string">""</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>postcard<span class="lg-highlight-string">", qty: 45, tags: ["</span>blue<span class="lg-highlight-string">"], dim_cm: [ 10, 15.25 ] }"</span><span class="lg-highlight-string">""</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)).<span class="lg-highlight-title lg-highlight-function">execute</span>()</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-76-menu" aria-describedby="select-76-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-77" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rja:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rja:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rja:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rja:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-array-match-exact"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Match an Array <a class="headerlink leafygreen-ui-1kepx47" href="#match-an-array" 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="match-an-array"> </div> </a> </h2> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-7"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_3nsjszes1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5pfb80465" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_pfk7y7ms1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ixyb68yln" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_er5q5y26r" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_4bko585mv" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_1kpjv1hh2" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_b1ybo12jo" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_p10vtf9rw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_j2iinzb8s" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_xngjhp1er" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_xxhlbtxuo" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_7arvsgcrw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_92w5o6c58" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_7ufv8hb8y" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_3sxavpeqs" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_8iu45m56d" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_n29nmjqzt" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_gox932vrj" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_eh5wkjfu5" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_hrvyzekiv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_poz85p0vb" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_ryk8a4cdv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tgbpiaygo" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_djv2hqjtj" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_vruni6iin" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_4r91nhigl" class="leafygreen-ui-38lglc" id="_9axl9qx0b" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify equality condition on an array, use the query document <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt;: &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements. </p> </div> </div> </div> <div> <div aria-labelledby="_y4c35cjx4" class="leafygreen-ui-38lglc" id="_5zpct3nbh" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify equality condition on an array, use the query document <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt;: &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements. </p> </div> </div> </div> <div> <div aria-labelledby="_dxu1vtjir" class="leafygreen-ui-38lglc" id="_3nrjal52i" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify equality condition on an array, use the query document <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt;: &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements. </p> </div> </div> </div> <div> <div aria-labelledby="_0rsqr06kn" class="leafygreen-ui-38lglc" id="_0kjg2cj6o" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify equality condition on an array, construct a filter using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/Overload_MongoDB_Driver_FilterDefinitionBuilder_1_Eq.htm" rel="noopener noreferrer"> <span> Eq </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> method, where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"Builders&lt;bsondocument&gt;.Filter.Eq(&lt;field&gt;, &lt;value&gt;)","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>.<span class="lg-highlight-title lg-highlight-class">Eq</span>(&lt;field&gt;, &lt;value&gt;)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-79-menu" aria-describedby="select-79-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-80" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjb:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjb:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjb:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjb:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_soa5ngrhp" class="leafygreen-ui-38lglc" id="_vgg77wus4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify equality condition on an array, use the query document <code class="leafygreen-ui-1l06pbn"> eq( &lt;field&gt;, &lt;value&gt;) </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements. </p> </div> </div> </div> <div> <div aria-labelledby="_he4m65kz5" class="leafygreen-ui-38lglc" id="_ds82aznm5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify equality condition on an array, use the query document <code class="leafygreen-ui-1l06pbn"> eq( &lt;field&gt;, &lt;value&gt;) </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements. </p> </div> </div> </div> <div> <div aria-labelledby="_xqux2gqmf" class="leafygreen-ui-38lglc" id="_plecfyr9c" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify equality condition on an array, use the query document <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt;: &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements. </p> </div> </div> </div> <div> <div aria-labelledby="_d2p1l3guf" class="" id="_sm0v8n3rl" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify equality condition on an array, use the query document <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt;: &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements. </p> </div> </div> </div> <div> <div aria-labelledby="_xqiokhyxr" class="leafygreen-ui-38lglc" id="_p3h2e8h2t" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify equality condition on an array, use the query document <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt; =&gt; &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements. </p> </div> </div> </div> <div> <div aria-labelledby="_oompk4sik" class="leafygreen-ui-38lglc" id="_pj6jyctsp" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify equality condition on an array, use the query document <code class="leafygreen-ui-1l06pbn"> [ &lt;field&gt; =&gt; &lt;value&gt; ] </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements. </p> </div> </div> </div> <div> <div aria-labelledby="_w5964cs1y" class="leafygreen-ui-38lglc" id="_p51rh6kyx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify equality condition on an array, use the query document <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt;: &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements. </p> </div> </div> </div> <div> <div aria-labelledby="_9udh0dm4t" class="leafygreen-ui-38lglc" id="_ykff0787h" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify equality condition on an array, use the query document <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt; =&gt; &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements. </p> </div> </div> </div> <div> <div aria-labelledby="_ksnbcxa9l" class="leafygreen-ui-38lglc" id="_36t1ohnm9" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify equality condition on an array, use the query document <code class="leafygreen-ui-1l06pbn"> equal( &lt;field&gt;, &lt;value&gt; ) </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements. </p> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example queries for all documents where the field <code class="leafygreen-ui-1l06pbn"> tags </code> value is an array with exactly two elements, <code class="leafygreen-ui-1l06pbn"> "red" </code> and <code class="leafygreen-ui-1l06pbn"> "blank" </code> , in the specified order: </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-8"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_vqi1pno37" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_351qfqoy1" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_rendjabso" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_eln5fepp2" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_egv10gwtr" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_wn0z397t7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_3950rktbw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_hm1xlqx2k" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_3l2q5lj44" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_g43uc80cu" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_asnv66ib0" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_xlvg2yy0j" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_bc7o3mcdl" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2ej572ofm" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_p3275z4ad" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_geerbt21e" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_9dqseykqm" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_k6yn05del" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_90t7ivgc5" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_q3x3cwyk6" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_5h2spaia1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ett0jxp0v" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_vmz1z3sh2" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_yzrm2gthh" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_10fu7s9b6" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_xev2k0td0" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_hiq32hz7x" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_x643vap5h" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_kucvemdr2" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9df2guota" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_jh5cbnflb" class="leafygreen-ui-38lglc" id="_86r0rdeqr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find( { tags: [\"red\", \"blank\"] } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>] } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-82-menu" aria-describedby="select-82-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-83" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjc:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjc:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjc:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjc:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_wqlk6z5il" class="leafygreen-ui-38lglc" id="_tuccbypmq" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> Copy the following filter into the Compass query bar and click <span class="guilabel css-h15tq0"> Find </span> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ tags: [\"red\", \"blank\"] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>] }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-85-menu" aria-describedby="select-85-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-86" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjd:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjd:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjd:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjd:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:772px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='307'%20width='772'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Query array matching exactly" data-main-image="" decoding="async" height="307" loading="lazy" sizes="(min-width: 772px) 772px, 100vw" src="/docs/manual/static/1e99a4b5a92f8ca54a0729378a2b0652/3d047/compass-array-match-exact.webp" srcset="/docs/manual/static/1e99a4b5a92f8ca54a0729378a2b0652/9a120/compass-array-match-exact.webp 193w,/docs/manual/static/1e99a4b5a92f8ca54a0729378a2b0652/91751/compass-array-match-exact.webp 386w,/docs/manual/static/1e99a4b5a92f8ca54a0729378a2b0652/3d047/compass-array-match-exact.webp 772w" style="--border-color:#C1C7C6;opacity:0" width="772"/> <noscript> <img alt="Query array matching exactly" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="307" loading="lazy" sizes="(min-width: 772px) 772px, 100vw" src="/docs/manual/static/1e99a4b5a92f8ca54a0729378a2b0652/3d047/compass-array-match-exact.webp" srcset="/docs/manual/static/1e99a4b5a92f8ca54a0729378a2b0652/9a120/compass-array-match-exact.webp 193w,/docs/manual/static/1e99a4b5a92f8ca54a0729378a2b0652/91751/compass-array-match-exact.webp 386w,/docs/manual/static/1e99a4b5a92f8ca54a0729378a2b0652/3d047/compass-array-match-exact.webp 772w" style="--border-color:#C1C7C6;opacity:0" width="772"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_hnros4180" class="leafygreen-ui-38lglc" id="_zxrsr9cth" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongoc_collection_t *collection;\nbson_t *filter;\nmongoc_cursor_t *cursor;\n\ncollection = mongoc_database_get_collection (db, \"inventory\");\nfilter = BCON_NEW (\n \"tags\", \"[\",\n BCON_UTF8 (\"red\"), BCON_UTF8 (\"blank\"),\n \"]\");\ncursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongoc_collection_t *collection;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *filter;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongoc_cursor_t *cursor;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection <!-- -->= <!-- -->mongoc_database_get_collection (db<!-- -->, <span class="lg-highlight-string">"inventory"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">filter <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"["</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"red"</span>)<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<span class="lg-highlight-string">"blank"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"]"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">cursor <!-- -->= <!-- -->mongoc_collection_find_with_opts (collection, filter<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-88-menu" aria-describedby="select-88-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-89" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rje:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rje:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rje:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rje:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_wd41t1rgt" class="leafygreen-ui-38lglc" id="_8wx0pkai2" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var filter = Builders&lt;bsondocument&gt;.Filter.Eq(\"tags\", new[] { \"red\", \"blank\" });\nvar result = collection.Find(filter).ToList();","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> filter = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>.<span class="lg-highlight-title lg-highlight-class">Eq</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-keyword">new</span>[] { <span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span> });</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> result = collection.<span class="lg-highlight-title lg-highlight-class">Find</span>(filter).<span class="lg-highlight-title lg-highlight-class">ToList</span>();</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-91-menu" aria-describedby="select-91-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-92" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjf:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjf:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjf:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjf:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_hhvgvwbug" class="leafygreen-ui-38lglc" id="_sldqvw2vg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\ncursor, err := coll.Find(\n\tcontext.TODO(),\n\tbson.D{{\"tags\", bson.A{\"red\", \"blank\"}}},\n)\n","programmingLanguage":"Golang"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor<!-- -->, <!-- -->err := coll.<span class="lg-highlight-title lg-highlight-class">Find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> context.<span class="lg-highlight-title lg-highlight-function">TODO</span>(),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{{<span class="lg-highlight-string">"tags"</span>, bson.<span class="lg-highlight-property">A</span>{<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>}}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-94-menu" aria-describedby="select-94-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-95" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjg:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjg:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjg:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjg:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_6s7lwjcq7" class="leafygreen-ui-38lglc" id="_wyyrufpsj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"FindPublisher&lt;document&gt; findPublisher = collection.find(eq(\"tags\", asList(\"red\", \"blank\")));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">FindPublisher</span>&lt;<span class="lg-highlight-title lg-highlight-class">Document</span>&gt; findPublisher = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">eq</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-title lg-highlight-function">asList</span>(<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-97-menu" aria-describedby="select-97-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-98" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjh:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjh:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjh:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjh:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_0609ub8am" class="leafygreen-ui-38lglc" id="_bzmtf7bvx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"FindIterable&lt;document&gt; findIterable = collection.find(eq(\"tags\", asList(\"red\", \"blank\")));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">FindIterable</span>&lt;<span class="lg-highlight-title lg-highlight-class">Document</span>&gt; findIterable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">eq</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-title lg-highlight-function">asList</span>(<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-100-menu" aria-describedby="select-100-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-101" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rji:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rji:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rji:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rji:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_qz5fo4zbn" class="leafygreen-ui-38lglc" id="_bfvemqw4h" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"val findFlow = collection\n .find(eq(\"tags\", listOf(\"red\", \"blank\")))","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">val findFlow = collection</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">eq</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-title lg-highlight-function">listOf</span>(<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>)))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-103-menu" aria-describedby="select-103-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-104" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjj:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjj:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjj:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjj:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_9dhxxeu68" class="leafygreen-ui-38lglc" id="_54bf1ow0o" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"tags\": [\"red\", \"blank\"]})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"tags"</span>: [<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>]})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-106-menu" aria-describedby="select-106-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-107" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjk:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjk:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjk:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjk:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_g6x0z7p52" class="" id="_2yzbnhoo9" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"const cursor = db.collection('inventory').find({\n tags: ['red', 'blank']\n});","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> cursor <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">collection</span>(<span class="lg-highlight-string">'inventory'</span>).<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">'red'</span>, <span class="lg-highlight-string">'blank'</span>]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-109-menu" aria-describedby="select-109-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-110" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjl:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjl:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjl:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjl:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_hyu55thfu" class="leafygreen-ui-38lglc" id="_cf54a66r1" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;coll(\"inventory\")-&gt;find( { tags =&gt; [ \"red\", \"blank\" ] } );","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor<!-- --> <!-- -->= <!-- -->$db<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">coll</span>(<span class="lg-highlight-string">"inventory"</span>)<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-params lg-highlight-function">tags</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <!-- -->[ <span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span> ] } );</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-112-menu" aria-describedby="select-112-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-113" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjm:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjm:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjm:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjm:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_oqlf4vgvu" class="leafygreen-ui-38lglc" id="_k0ka0qaa7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;inventory-&gt;find(['tags' =&gt; ['red', 'blank']]);","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor = $db-&gt;inventory-&gt;<span class="lg-highlight-title lg-highlight-function">find</span>([<!-- --><span class="lg-highlight-string">'tags'</span> =&gt; [<span class="lg-highlight-string">'red'</span>, <span class="lg-highlight-string">'blank'</span>]]);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-115-menu" aria-describedby="select-115-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-116" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjn:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjn:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjn:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjn:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_ovpccnkxl" class="leafygreen-ui-38lglc" id="_fi1f1nk0o" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"tags\": [\"red\", \"blank\"]})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"tags"</span>: [<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>]})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-118-menu" aria-describedby="select-118-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-119" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjo:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjo:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjo:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjo:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_6tdybrye0" class="leafygreen-ui-38lglc" id="_t1buf8d99" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client[:inventory].find(tags: ['red', 'blank'])","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client<!-- -->[<!-- -->:inventory].<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-attr">tags</span>: <!-- -->[<span class="lg-highlight-string">'red'</span>, <span class="lg-highlight-string">'blank'</span>])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-121-menu" aria-describedby="select-121-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-122" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjp:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjp:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjp:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjp:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_qzgwh2gd5" class="leafygreen-ui-38lglc" id="_wmn3v3inh" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var findObservable = collection.find(equal(\"tags\", Seq(\"red\", \"blank\")))","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> findObservable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">equal</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-title lg-highlight-class">Seq</span>(<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>)))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-124-menu" aria-describedby="select-124-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-125" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjq:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjq:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjq:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjq:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If, instead, you wish to find an array that contains both the elements <code class="leafygreen-ui-1l06pbn"> "red" </code> and <code class="leafygreen-ui-1l06pbn"> "blank" </code> , without regard to order or other elements in the array, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/all/#mongodb-query-op.-all"> <code class="leafygreen-ui-1l06pbn"> $all </code> </a> operator: </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-9"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_2varznoy3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_z0uhsgitn" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_qqkkqx1xj" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_m59u3u7yk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_mo6y27k29" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ql5b9ch0w" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_izotoqpu1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_rl7ls7et2" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_bud9xa2lw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_zeu0d26g3" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_6419miuut" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_3vl6o2x72" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_uyoh34j4j" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_g0slfhua4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_o1k5vxg1x" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lj84k58tr" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_hczaynm9g" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_cjedd15sd" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_flikxlyvq" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_ikeb9ohf2" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_chmu3qc9w" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_engdqjtaj" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_nvws2wfk9" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_t09hgfl99" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_pczmeaci1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tkkaldmmr" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_8opm4hduc" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_137s57xqi" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_wdmhppgfj" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2nbhopix8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_pl9wq6c43" class="leafygreen-ui-38lglc" id="_ezngiv7jk" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find( { tags: { $all: [\"red\", \"blank\"] } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">tags</span>: <!-- -->{ <span class="lg-highlight-attr">$all</span>: <!-- -->[<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>] } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-127-menu" aria-describedby="select-127-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-128" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjr:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjr:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjr:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjr:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_t3oxmn2me" class="leafygreen-ui-38lglc" id="_jybjs5bbc" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> Copy the following filter into the Compass query bar and click <span class="guilabel css-h15tq0"> Find </span> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ tags: { $all: [\"red\", \"blank\"] } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">tags</span>: <!-- -->{ <span class="lg-highlight-attr">$all</span>: <!-- -->[<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>] } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-130-menu" aria-describedby="select-130-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-131" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjs:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjs:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjs:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjs:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:774px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='738'%20width='774'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Query array matching all criteria" data-main-image="" decoding="async" height="738" loading="lazy" sizes="(min-width: 774px) 774px, 100vw" src="/docs/manual/static/fc29d274254585981fb6a0809e207476/76328/compass-array-match-all.webp" srcset="/docs/manual/static/fc29d274254585981fb6a0809e207476/00991/compass-array-match-all.webp 194w,/docs/manual/static/fc29d274254585981fb6a0809e207476/45746/compass-array-match-all.webp 387w,/docs/manual/static/fc29d274254585981fb6a0809e207476/76328/compass-array-match-all.webp 774w" style="--border-color:#C1C7C6;opacity:0" width="774"/> <noscript> <img alt="Query array matching all criteria" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="738" loading="lazy" sizes="(min-width: 774px) 774px, 100vw" src="/docs/manual/static/fc29d274254585981fb6a0809e207476/76328/compass-array-match-all.webp" srcset="/docs/manual/static/fc29d274254585981fb6a0809e207476/00991/compass-array-match-all.webp 194w,/docs/manual/static/fc29d274254585981fb6a0809e207476/45746/compass-array-match-all.webp 387w,/docs/manual/static/fc29d274254585981fb6a0809e207476/76328/compass-array-match-all.webp 774w" style="--border-color:#C1C7C6;opacity:0" width="774"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_mhadjdpe5" class="leafygreen-ui-38lglc" id="_rlvwti24a" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongoc_collection_t *collection;\nbson_t *filter;\nmongoc_cursor_t *cursor;\n\ncollection = mongoc_database_get_collection (db, \"inventory\");\nfilter = BCON_NEW (\n \"tags\", \"{\",\n \"$all\", \"[\",\n BCON_UTF8 (\"red\"), BCON_UTF8 (\"blank\"),\n \"]\",\n \"}\");\ncursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongoc_collection_t *collection;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *filter;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongoc_cursor_t *cursor;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection <!-- -->= <!-- -->mongoc_database_get_collection (db<!-- -->, <span class="lg-highlight-string">"inventory"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">filter <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$all"</span>, <span class="lg-highlight-string">"["</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"red"</span>)<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<span class="lg-highlight-string">"blank"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"]"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">cursor <!-- -->= <!-- -->mongoc_collection_find_with_opts (collection, filter<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-133-menu" aria-describedby="select-133-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-134" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjt:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjt:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjt:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjt:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_btxilku5h" class="leafygreen-ui-38lglc" id="_a6ur1j6w4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var filter = Builders&lt;bsondocument&gt;.Filter.All(\"tags\", new[] { \"red\", \"blank\" });\nvar result = collection.Find(filter).ToList();","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> filter = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>.<span class="lg-highlight-title lg-highlight-class">All</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-keyword">new</span>[] { <span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span> });</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> result = collection.<span class="lg-highlight-title lg-highlight-class">Find</span>(filter).<span class="lg-highlight-title lg-highlight-class">ToList</span>();</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-136-menu" aria-describedby="select-136-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-137" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rju:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rju:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rju:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rju:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_728708xi7" class="leafygreen-ui-38lglc" id="_1ohc43fcd" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\ncursor, err := coll.Find(\n\tcontext.TODO(),\n\tbson.D{\n\t\t{\"tags\", bson.D{{\"$all\", bson.A{\"red\", \"blank\"}}}},\n\t})\n","programmingLanguage":"Golang"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor<!-- -->, <!-- -->err := coll.<span class="lg-highlight-title lg-highlight-class">Find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> context.<span class="lg-highlight-title lg-highlight-function">TODO</span>(),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"tags"</span>, bson.<span class="lg-highlight-property">D</span>{{<span class="lg-highlight-string">"$all"</span>, bson.<span class="lg-highlight-property">A</span>{<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>}}}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-139-menu" aria-describedby="select-139-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-140" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rjv:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rjv:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjv:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rjv:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_9svg8eal5" class="leafygreen-ui-38lglc" id="_hi61zg8ay" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findPublisher = collection.find(all(\"tags\", asList(\"red\", \"blank\")));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findPublisher = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">all</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-title lg-highlight-function">asList</span>(<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-142-menu" aria-describedby="select-142-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-143" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rk0:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rk0:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk0:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk0:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_84tn37wk8" class="leafygreen-ui-38lglc" id="_6xcxjts41" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findIterable = collection.find(all(\"tags\", asList(\"red\", \"blank\")));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findIterable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">all</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-title lg-highlight-function">asList</span>(<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-145-menu" aria-describedby="select-145-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-146" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rk1:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rk1:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk1:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk1:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_r8nasdhmr" class="leafygreen-ui-38lglc" id="_eg7hfqdcg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"val findFlow = collection\n .find(all(\"tags\", listOf(\"red\", \"blank\")))","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">val findFlow = collection</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">all</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-title lg-highlight-function">listOf</span>(<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>)))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-148-menu" aria-describedby="select-148-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-149" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rk2:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rk2:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk2:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk2:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_5fxwsda5o" class="leafygreen-ui-38lglc" id="_iv7pzo8d9" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"tags\": {\"$all\": [\"red\", \"blank\"]}})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"tags"</span>: {<span class="lg-highlight-string">"$all"</span>: [<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>]}})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-151-menu" aria-describedby="select-151-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-152" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rk3:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rk3:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk3:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk3:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_q7g5je6lh" class="" id="_ch7b5na63" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"const cursor = db.collection('inventory').find({\n tags: { $all: ['red', 'blank'] }\n});","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> cursor <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">collection</span>(<span class="lg-highlight-string">'inventory'</span>).<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->{ <span class="lg-highlight-attr">$all</span>: <!-- -->[<span class="lg-highlight-string">'red'</span>, <span class="lg-highlight-string">'blank'</span>] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-154-menu" aria-describedby="select-154-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-155" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rk4:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rk4:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk4:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk4:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_uy0etzdyb" class="leafygreen-ui-38lglc" id="_37wkju7s5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;coll(\"inventory\")-&gt;find( { tags =&gt; { '$all' =&gt; [ \"red\", \"blank\" ] } } );","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor<!-- --> <!-- -->= <!-- -->$db<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">coll</span>(<span class="lg-highlight-string">"inventory"</span>)<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-params lg-highlight-function">tags</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <!-- -->{ <span class="lg-highlight-string">'$all'</span> <!-- -->=<!-- -->&gt; <!-- -->[ <span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span> ] } } );</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-157-menu" aria-describedby="select-157-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-158" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rk5:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rk5:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk5:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk5:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_yj3plel56" class="leafygreen-ui-38lglc" id="_7gh8fiuzx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;inventory-&gt;find(['tags' =&gt; ['$all' =&gt; ['red', 'blank']]]);","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor = $db-&gt;inventory-&gt;<span class="lg-highlight-title lg-highlight-function">find</span>([<span class="lg-highlight-string">'tags'</span> <!-- -->=&gt; [<span class="lg-highlight-string">'$all'</span> =&gt; [<span class="lg-highlight-string">'red'</span>, <span class="lg-highlight-string">'blank'</span>]]]);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-160-menu" aria-describedby="select-160-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-161" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rk6:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rk6:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk6:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk6:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_uhiv2jbrm" class="leafygreen-ui-38lglc" id="_vuwgeqw6u" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"tags\": {\"$all\": [\"red\", \"blank\"]}})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"tags"</span>: {<span class="lg-highlight-string">"$all"</span>: [<span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>]}})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-163-menu" aria-describedby="select-163-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-164" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rk7:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rk7:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk7:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk7:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_vv7va8j9c" class="leafygreen-ui-38lglc" id="_zm6t8ukp2" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client[:inventory].find(tags: { '$all' =&gt; ['red', 'blank'] })","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client<!-- -->[<!-- -->:inventory].<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-attr">tags</span>: <!-- -->{ <span class="lg-highlight-string">'$all'</span> <!-- -->=<!-- -->&gt; <!-- -->[<span class="lg-highlight-string">'red'</span>, <span class="lg-highlight-string">'blank'</span>] })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-166-menu" aria-describedby="select-166-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-167" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rk8:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rk8:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk8:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk8:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_26p39xa0q" class="leafygreen-ui-38lglc" id="_xg2ft4p7h" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findObservable = collection.find(all(\"tags\", \"red\", \"blank\"))","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findObservable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">all</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"red"</span>, <span class="lg-highlight-string">"blank"</span>))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-169-menu" aria-describedby="select-169-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-170" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rk9:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rk9:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk9:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rk9:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-array-match-single-element"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Query an Array for an Element <a class="headerlink leafygreen-ui-1kepx47" href="#query-an-array-for-an-element" 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="query-an-array-for-an-element"> </div> </a> </h2> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-11"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_6qfkgfztq" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_b78aaceqa" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_7emib0dk5" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_yasulvz8z" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_gyfw6ea4g" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_oh0mf7ad7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_0w5t9p7tf" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ahs68f2lp" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_spo0ohuau" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_pa00n3rvx" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_gvp9mud37" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_thjdwv7m3" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_nb2l3x4du" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_7xr8d9vfz" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_x8m6d74t5" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fnjgnce0j" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_b0btxicri" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2np5qndvr" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_1kkp11z6x" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_idhqbky9o" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_qoqcbmqis" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_t0u858bvv" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_jhv4drj9s" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_bzhpqsvpx" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_tnn37imsf" class="leafygreen-ui-38lglc" id="_rbparxify" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To query if the array field contains at least <em> one </em> element with the specified value, use the filter <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt;: &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the element value. </p> </div> </div> </div> <div> <div aria-labelledby="_464egxn6j" class="leafygreen-ui-38lglc" id="_mqcxgmab2" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To query if the array field contains at least <em> one </em> element with the specified value, use the filter <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt;: &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the element value. </p> </div> </div> </div> <div> <div aria-labelledby="_val26b24c" class="leafygreen-ui-38lglc" id="_qlyi1rjef" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To query if the array field contains at least <em> one </em> element with the specified value, construct a filter using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/Overload_MongoDB_Driver_FilterDefinitionBuilder_1_Eq.htm" rel="noopener noreferrer"> <span> Eq </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> method, where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the element value to match: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"Builders&lt;bsondocument&gt;.Filter.Eq(&lt;field&gt;, &lt;value&gt;)","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>.<span class="lg-highlight-title lg-highlight-class">Eq</span>(&lt;field&gt;, &lt;value&gt;)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-172-menu" aria-describedby="select-172-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-173" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rka:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rka:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rka:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rka:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_75x8swoor" class="leafygreen-ui-38lglc" id="_6ku7fm3p9" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To query if the array field contains at least <em> one </em> element with the specified value, use the filter <code class="leafygreen-ui-1l06pbn"> eq( &lt;field&gt;, &lt;value&gt;) </code> where value is the element value. </p> </div> </div> </div> <div> <div aria-labelledby="_mbimm3nl8" class="leafygreen-ui-38lglc" id="_8t56ba8ih" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To query if the array field contains at least <em> one </em> element with the specified value, use the filter <code class="leafygreen-ui-1l06pbn"> eq( &lt;field&gt;, &lt;value&gt;) </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the element value. </p> </div> </div> </div> <div> <div aria-labelledby="_6c3dwuos7" class="leafygreen-ui-38lglc" id="_kmm9epjjq" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To query if the array field contains at least <em> one </em> element with the specified value, use the filter <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt;: &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the element value. </p> </div> </div> </div> <div> <div aria-labelledby="_4fmotoztq" class="" id="_fzcj6bywj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To query if the array field contains at least <em> one </em> element with the specified value, use the filter <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt;: &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the element value. </p> </div> </div> </div> <div> <div aria-labelledby="_3ajstbo55" class="leafygreen-ui-38lglc" id="_xyo07yved" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To query if the array field contains at least <em> one </em> element with the specified value, use the filter </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt; =&gt; &lt;value&gt; } </code> where value is the element value. </p> </div> </div> </div> <div> <div aria-labelledby="_di1qcoj38" class="leafygreen-ui-38lglc" id="_08mmihsah" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To query if the array field contains at least <em> one </em> element with the specified value, use the filter <code class="leafygreen-ui-1l06pbn"> [ &lt;field&gt; =&gt; &lt;value&gt; ] </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the element value. </p> </div> </div> </div> <div> <div aria-labelledby="_2chz72d9v" class="leafygreen-ui-38lglc" id="_7cu0v9zut" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To query if the array field contains at least <em> one </em> element with the specified value, use the filter <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt;: &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the element value. </p> </div> </div> </div> <div> <div aria-labelledby="_iweoritpm" class="leafygreen-ui-38lglc" id="_20a93v47z" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To query if the array field contains at least <em> one </em> element with the specified value, use the filter <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt; =&gt; &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the element value. </p> </div> </div> </div> <div> <div aria-labelledby="_rzvppmufi" class="leafygreen-ui-38lglc" id="_afq6wde35" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To query if the array field contains at least <em> one </em> element with the specified value, use the filter <code class="leafygreen-ui-1l06pbn"> equal( &lt;field&gt;, &lt;value&gt; ) </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the element value. </p> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example queries for all documents where <code class="leafygreen-ui-1l06pbn"> tags </code> is an array that contains the string <code class="leafygreen-ui-1l06pbn"> "red" </code> as one of its elements: </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-12"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_9pe63mq0c" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_n9tynq6j6" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_11bnj2pbk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_d3il61zp0" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_cirobmeu3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_e24t5gaor" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_oc5mw5a5d" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_q62wdb0z8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_llqqqfylh" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_54bufqf5q" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_xcx4e007e" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fgtipjy77" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_w87dm9e5s" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_dzm36h079" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_cnispoxl3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_zffyjkd2p" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_7c1g28cmn" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_z3cjcis9k" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_tvphjd53g" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_vw5s2og3i" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_9uiwy7052" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_aj3mltkdv" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_bqxiyn0ma" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_aolrrkc7p" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_l1b52wryh" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_mof6b84rn" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_148sdl7ob" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_n965s1uzh" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_5htfwbf3l" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_jm0apcv14" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_rg9oyzvr7" class="leafygreen-ui-38lglc" id="_y4uc08cku" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find( { tags: \"red\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">tags</span>: <span class="lg-highlight-string">"red"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-175-menu" aria-describedby="select-175-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-176" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkb:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkb:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkb:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkb:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_owykpg1ut" class="leafygreen-ui-38lglc" id="_wze3yjlzy" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> Copy the following filter into the Compass query bar and click <span class="guilabel css-h15tq0"> Find </span> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ tags: \"red\" }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">tags</span>: <span class="lg-highlight-string">"red"</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-178-menu" aria-describedby="select-178-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-179" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkc:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkc:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkc:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkc:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:773px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='739'%20width='773'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Query array matching multiple criteria" data-main-image="" decoding="async" height="739" loading="lazy" sizes="(min-width: 773px) 773px, 100vw" src="/docs/manual/static/c386fdbd75d80529d5040298da52373d/62c43/compass-array-elem-match.webp" srcset="/docs/manual/static/c386fdbd75d80529d5040298da52373d/4cf20/compass-array-elem-match.webp 193w,/docs/manual/static/c386fdbd75d80529d5040298da52373d/ca8e2/compass-array-elem-match.webp 387w,/docs/manual/static/c386fdbd75d80529d5040298da52373d/62c43/compass-array-elem-match.webp 773w" style="--border-color:#C1C7C6;opacity:0" width="773"/> <noscript> <img alt="Query array matching multiple criteria" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="739" loading="lazy" sizes="(min-width: 773px) 773px, 100vw" src="/docs/manual/static/c386fdbd75d80529d5040298da52373d/62c43/compass-array-elem-match.webp" srcset="/docs/manual/static/c386fdbd75d80529d5040298da52373d/4cf20/compass-array-elem-match.webp 193w,/docs/manual/static/c386fdbd75d80529d5040298da52373d/ca8e2/compass-array-elem-match.webp 387w,/docs/manual/static/c386fdbd75d80529d5040298da52373d/62c43/compass-array-elem-match.webp 773w" style="--border-color:#C1C7C6;opacity:0" width="773"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_5tem5z4nq" class="leafygreen-ui-38lglc" id="_htgoiwt2p" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongoc_collection_t *collection;\nbson_t *filter;\nmongoc_cursor_t *cursor;\n\ncollection = mongoc_database_get_collection (db, \"inventory\");\nfilter = BCON_NEW (\"tags\", BCON_UTF8 (\"red\"));\ncursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongoc_collection_t *collection;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *filter;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongoc_cursor_t *cursor;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection <!-- -->= <!-- -->mongoc_database_get_collection (db<!-- -->, <span class="lg-highlight-string">"inventory"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">filter <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (<!-- --><!-- --><span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> <!-- -->(<span class="lg-highlight-string">"red"</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx">cursor <!-- -->= <!-- -->mongoc_collection_find_with_opts (collection, filter<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-181-menu" aria-describedby="select-181-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-182" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkd:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkd:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkd:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkd:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_l9ygu0e14" class="leafygreen-ui-38lglc" id="_tdqxzt4x5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var filter = Builders&lt;bsondocument&gt;.Filter.Eq(\"tags\", \"red\");\nvar result = collection.Find(filter).ToList();","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> filter = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>.<span class="lg-highlight-title lg-highlight-class">Eq</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"red"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> result = collection.<span class="lg-highlight-title lg-highlight-class">Find</span>(filter).<span class="lg-highlight-title lg-highlight-class">ToList</span>();</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-184-menu" aria-describedby="select-184-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-185" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rke:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rke:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rke:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rke:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_fv273io1p" class="leafygreen-ui-38lglc" id="_4idkgmwxo" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\ncursor, err := coll.Find(\n\tcontext.TODO(),\n\tbson.D{\n\t\t{\"tags\", \"red\"},\n\t})\n","programmingLanguage":"Golang"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor<!-- -->, <!-- -->err := coll.<span class="lg-highlight-title lg-highlight-class">Find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> context.<span class="lg-highlight-title lg-highlight-function">TODO</span>(),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"red"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-187-menu" aria-describedby="select-187-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-188" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkf:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkf:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkf:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkf:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_5snc5ckga" class="leafygreen-ui-38lglc" id="_xya6uhtpj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findPublisher = collection.find(eq(\"tags\", \"red\"));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findPublisher = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">eq</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"red"</span>));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-190-menu" aria-describedby="select-190-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-191" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkg:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkg:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkg:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkg:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_d1x1hv59q" class="leafygreen-ui-38lglc" id="_4mrmcuvcr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findIterable = collection.find(eq(\"tags\", \"red\"));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findIterable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">eq</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"red"</span>));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-193-menu" aria-describedby="select-193-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-194" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkh:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkh:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkh:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkh:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_76702d11y" class="leafygreen-ui-38lglc" id="_i2gto5558" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"val findFlow = collection\n .find(eq(\"tags\", \"red\"))","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">val findFlow = collection</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">eq</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"red"</span>))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-196-menu" aria-describedby="select-196-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-197" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rki:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rki:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rki:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rki:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_pprnzp8bt" class="leafygreen-ui-38lglc" id="_9ovhxsr9r" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"tags\": \"red\"})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"tags"</span>: <span class="lg-highlight-string">"red"</span>})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-199-menu" aria-describedby="select-199-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-200" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkj:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkj:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkj:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkj:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_yx5ai76ti" class="" id="_0lhrrnugv" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"const cursor = db.collection('inventory').find({\n tags: 'red'\n});","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> cursor <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">collection</span>(<span class="lg-highlight-string">'inventory'</span>).<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <span class="lg-highlight-string">'red'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">})<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-202-menu" aria-describedby="select-202-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-203" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkk:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkk:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkk:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkk:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_0mmij3vd4" class="leafygreen-ui-38lglc" id="_57vdwao3j" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;coll(\"inventory\")-&gt;find( { tags =&gt; \"red\" } );","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor<!-- --> <!-- -->= <!-- -->$db<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">coll</span>(<span class="lg-highlight-string">"inventory"</span>)<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-params lg-highlight-function">tags</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"red"</span> } );</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-205-menu" aria-describedby="select-205-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-206" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkl:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkl:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkl:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkl:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_plwlmt20s" class="leafygreen-ui-38lglc" id="_774l6rqjj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;inventory-&gt;find(['tags' =&gt; 'red']);","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor = $db-&gt;inventory-<!-- -->&gt;<span class="lg-highlight-title lg-highlight-function">find</span>([<span class="lg-highlight-string">'tags'</span> =&gt; <span class="lg-highlight-string">'red'</span>]);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-208-menu" aria-describedby="select-208-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-209" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkm:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkm:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkm:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkm:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_yxlr4taey" class="leafygreen-ui-38lglc" id="_p2zc8q5pg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"tags\": \"red\"})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"tags"</span>: <span class="lg-highlight-string">"red"</span>})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-211-menu" aria-describedby="select-211-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-212" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkn:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkn:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkn:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkn:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_76ydtinru" class="leafygreen-ui-38lglc" id="_ri494wdmg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client[:inventory].find(tags: 'red')","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client<!-- -->[<!-- -->:inventory].<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-attr">tags</span>: <span class="lg-highlight-string">'red'</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-214-menu" aria-describedby="select-214-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-215" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rko:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rko:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rko:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rko:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_me9ae93nx" class="leafygreen-ui-38lglc" id="_2krav5j8r" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findObservable = collection.find(equal(\"tags\", \"red\"))","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findObservable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">equal</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"red"</span>))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-217-menu" aria-describedby="select-217-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-218" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkp:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkp:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkp:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkp:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-13"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_qkyt2puk6" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_zxni7e7n0" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_1bxhi30vn" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fexaulh18" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_8wdasv8ky" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_l0ukwwwt4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_qesjmnwk6" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_revcs79cc" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_x6zm5rryt" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fs8on80eu" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_gmzddjbn0" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_bnb91a5wd" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_nnt8yh34d" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lfh7n9oh7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_b2d7f0kub" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_8tx2aumxq" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_nm08j2d6p" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_uxebkzok0" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_unc8tktig" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_hyrxj50xf" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_5n6ovbd7r" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_nh2dgiwo0" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_rli4vhpzv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2yagxg5qx" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_do3zfxeb8" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_764bsvvwn" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_q6hhs23hp" class="leafygreen-ui-38lglc" id="_907lsdwwo" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ &lt;array&gt;: { &lt;operator1&gt;: &lt;value1&gt;, ... } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <!-- -->&lt;array field&gt;: { &lt;operator1&gt;: &lt;value1&gt;, ... } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-220-menu" aria-describedby="select-220-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-221" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkq:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkq:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkq:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkq:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_gpkwj59p5" class="leafygreen-ui-38lglc" id="_ft2u8o3pc" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ &lt;array&gt;: { &lt;operator1&gt;: &lt;value1&gt;, ... } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <!-- -->&lt;array field&gt;: { &lt;operator1&gt;: &lt;value1&gt;, ... } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-223-menu" aria-describedby="select-223-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-224" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkr:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkr:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkr:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkr:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_gh87hegep" class="leafygreen-ui-38lglc" id="_4q5242slc" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ &lt;array&gt;: { &lt;operator1&gt;: &lt;value1&gt;, ... } }","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ &lt;array field&gt;: { &lt;operator1&gt;: &lt;value1&gt;, ... } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-226-menu" aria-describedby="select-226-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-227" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rks:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rks:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rks:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rks:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_z5rksuq00" class="leafygreen-ui-38lglc" id="_l1ywwdl86" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document </a> . For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var builder = Builders&lt;bsondocument&gt;.Filter;\nbuilder.And(builder.Eq(&lt;array&gt;, &lt;value1&gt;), builder.Lt(&lt;array&gt;, &lt;value2&gt;));","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> builder = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">builder.<span class="lg-highlight-title lg-highlight-class">And</span>(builder.<span class="lg-highlight-title lg-highlight-class">Eq</span>(&lt;array field&gt;, &lt;value1&gt;), builder.Lt(&lt;array field&gt;, &lt;value2&gt;));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-229-menu" aria-describedby="select-229-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-230" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkt:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkt:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkt:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkt:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_xkv5wr11x" class="leafygreen-ui-38lglc" id="_dc7him9m6" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document </a> . For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"and(gte(&lt;array&gt;, &lt;value1&gt;), lt(&lt;array&gt;, &lt;value2&gt;) ...)","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">and</span>(<span class="lg-highlight-title lg-highlight-function">gte</span>(&lt;array field&gt;, &lt;value1&gt;), lt(&lt;array field&gt;, &lt;value2&gt;) ...)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-232-menu" aria-describedby="select-232-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-233" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rku:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rku:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rku:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rku:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_dcet374m4" class="leafygreen-ui-38lglc" id="_dzw6hkfbh" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document </a> . For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"and(gte(&lt;array&gt;, &lt;value1&gt;), lt(&lt;array&gt;, &lt;value2&gt;) ...)","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">and</span>(<span class="lg-highlight-title lg-highlight-function">gte</span>(&lt;array field&gt;, &lt;value1&gt;), lt(&lt;array field&gt;, &lt;value2&gt;) ...)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-235-menu" aria-describedby="select-235-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-236" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rkv:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rkv:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkv:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rkv:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_29qn08n89" class="leafygreen-ui-38lglc" id="_a47vvv4n6" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document </a> . For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"and(gte(&lt;array&gt;, &lt;value1&gt;), lt(&lt;array&gt;, &lt;value2&gt;) ...)","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">and</span>(<span class="lg-highlight-title lg-highlight-function">gte</span>(&lt;array field&gt;, &lt;value1&gt;), lt(&lt;array field&gt;, &lt;value2&gt;) ...)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-238-menu" aria-describedby="select-238-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-239" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rl0:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rl0:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl0:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl0:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_vbo59ej26" class="" id="_a1jgjuqa5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ &lt;array&gt;: { &lt;operator1&gt;: &lt;value1&gt;, ... } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <!-- -->&lt;array field&gt;: { &lt;operator1&gt;: &lt;value1&gt;, ... } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-241-menu" aria-describedby="select-241-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-242" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rl1:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rl1:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl1:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl1:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_bznuw8hnd" class="leafygreen-ui-38lglc" id="_kmpqymz2r" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ &lt;array&gt; =&gt; { &lt;operator1&gt; =&gt; &lt;value1&gt;, ... } }","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <!-- -->&lt;array field&gt; =&gt; { &lt;operator1&gt; =&gt; &lt;value1&gt;, ... } }<!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-244-menu" aria-describedby="select-244-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-245" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rl2:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rl2:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl2:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl2:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_55h5gbacs" class="leafygreen-ui-38lglc" id="_osz0k9lww" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[ &lt;array&gt; =&gt; [ &lt;operator1&gt; =&gt; &lt;value1&gt;, ... ] ]","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ &lt;array field&gt; =&gt; [ &lt;operator1&gt; =&gt; &lt;value1&gt;, ... ] ]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-247-menu" aria-describedby="select-247-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-248" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rl3:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rl3:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl3:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl3:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_h92p92drz" class="leafygreen-ui-38lglc" id="_69hq7x1oo" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ &lt;array&gt;: { &lt;operator1&gt;: &lt;value1&gt;, ... } }","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ &lt;array field&gt;: { &lt;operator1&gt;: &lt;value1&gt;, ... } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-250-menu" aria-describedby="select-250-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-251" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rl4:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rl4:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl4:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl4:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_0it45zu1f" class="leafygreen-ui-38lglc" id="_joyciexyw" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ &lt;array&gt; =&gt; { &lt;operator1&gt; =&gt; &lt;value1&gt;, ... } }","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <!-- -->&lt;array field&gt; =&gt; { &lt;operator1&gt; =&gt; &lt;value1&gt;, ... } }<!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-253-menu" aria-describedby="select-253-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-254" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rl5:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rl5:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl5:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl5:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_i7hycsa96" class="leafygreen-ui-38lglc" id="_gnm31frgx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"and(gte(&lt;array&gt;, &lt;value1&gt;), lt(&lt;array&gt;, &lt;value2&gt;) ...)","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">and</span>(<span class="lg-highlight-title lg-highlight-function">gte</span>(&lt;array field&gt;, &lt;value1&gt;), lt(&lt;array field&gt;, &lt;value2&gt;) ...)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-256-menu" aria-describedby="select-256-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-257" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rl6:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rl6:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl6:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl6:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For example, the following operation queries for all documents where the array <code class="leafygreen-ui-1l06pbn"> dim_cm </code> contains at least one element whose value is greater than <code class="leafygreen-ui-1l06pbn"> 25 </code> . </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-14"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_d0ulgzyi4" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_jvk2fz1jn" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_lzxkrw2ij" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_49kp2b1b1" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_0j9yxhj86" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_maany6v7s" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_dbfhy4nmo" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_qh01oc2cf" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_odc50l6u4" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_jmpykev7c" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_uncjff8o4" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ozfjtvn5l" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_cokvfjxjk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0bwt96zoe" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_3nbggzuhf" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_hp8rmytf3" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_krwp79fur" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_neylcl3lb" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_0wtrhreiq" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_o9g7n2jdh" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_i85f4o8mk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_x5cuqnbny" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_e2u5mxqem" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_be78tixqu" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_hxjrjctmp" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_njo0hd0m7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_y6xfgqsag" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_6rn7p3zec" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_18kcn90bj" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_at2rhux71" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_1htzmjz0v" class="leafygreen-ui-38lglc" id="_ss2bs6n0p" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find( { dim_cm: { $gt: 25 } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">dim_cm</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">25</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-259-menu" aria-describedby="select-259-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-260" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rl7:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rl7:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl7:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl7:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_2zw3lv7sz" class="leafygreen-ui-38lglc" id="_73iatmgtg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> Copy the following filter into the Compass query bar and click <span class="guilabel css-h15tq0"> Find </span> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ dim_cm: { $gt: 25 } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">dim_cm</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">25</span> } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-262-menu" aria-describedby="select-262-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-263" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rl8:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rl8:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl8:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl8:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_beeydlc18" class="leafygreen-ui-38lglc" id="_oe6wccib6" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongoc_collection_t *collection;\nbson_t *filter;\nmongoc_cursor_t *cursor;\n\ncollection = mongoc_database_get_collection (db, \"inventory\");\nfilter = BCON_NEW (\n \"dim_cm\", \"{\",\n \"$gt\", BCON_INT64 (25),\n \"}\");\ncursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongoc_collection_t *collection;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *filter;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongoc_cursor_t *cursor;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection <!-- -->= <!-- -->mongoc_database_get_collection (db<!-- -->, <span class="lg-highlight-string">"inventory"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">filter <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$gt"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">25</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">cursor <!-- -->= <!-- -->mongoc_collection_find_with_opts (collection, filter<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-265-menu" aria-describedby="select-265-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-266" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rl9:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rl9:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl9:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rl9:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_d3prqnh27" class="leafygreen-ui-38lglc" id="_ggsthv5p6" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var filter = Builders&lt;bsondocument&gt;.Filter.Gt(\"dim_cm\", 25);\nvar result = collection.Find(filter).ToList();","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> filter = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>.<span class="lg-highlight-title lg-highlight-class">Gt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">25</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> result = collection.<span class="lg-highlight-title lg-highlight-class">Find</span>(filter).<span class="lg-highlight-title lg-highlight-class">ToList</span>();</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-268-menu" aria-describedby="select-268-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-269" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rla:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rla:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rla:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rla:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_4xhb9kfla" class="leafygreen-ui-38lglc" id="_cw7bubxix" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\ncursor, err := coll.Find(\n\tcontext.TODO(),\n\tbson.D{\n\t\t{\"dim_cm\", bson.D{\n\t\t\t{\"$gt\", 25},\n\t\t}},\n\t})\n","programmingLanguage":"Golang"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor<!-- -->, <!-- -->err := coll.<span class="lg-highlight-title lg-highlight-class">Find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> context.<span class="lg-highlight-title lg-highlight-function">TODO</span>(),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"dim_cm"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$gt"</span>, <span class="lg-highlight-number">25</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-271-menu" aria-describedby="select-271-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-272" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlb:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlb:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlb:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlb:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_c0yrb8gxe" class="leafygreen-ui-38lglc" id="_zh50lfyax" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findPublisher = collection.find(gt(\"dim_cm\", 25));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findPublisher = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">gt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">25</span>));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-274-menu" aria-describedby="select-274-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-275" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlc:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlc:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlc:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlc:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_prbc8f6v4" class="leafygreen-ui-38lglc" id="_wo3tt6371" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findIterable = collection.find(gt(\"dim_cm\", 25));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findIterable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">gt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">25</span>));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-277-menu" aria-describedby="select-277-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-278" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rld:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rld:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rld:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rld:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_5tmp6k06y" class="leafygreen-ui-38lglc" id="_q306wmhl3" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"val findFlow = collection\n .find(gt(\"dim_cm\", 25))","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">val findFlow = collection</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">gt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">25</span>))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-280-menu" aria-describedby="select-280-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-281" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rle:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rle:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rle:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rle:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_brsd822nl" class="leafygreen-ui-38lglc" id="_mhb0qwoq7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"dim_cm\": {\"$gt\": 25}})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"dim_cm"</span>: {<span class="lg-highlight-string">"$gt"</span>: <span class="lg-highlight-number">25</span>}})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-283-menu" aria-describedby="select-283-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-284" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlf:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlf:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlf:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlf:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_xbj7pjycl" class="" id="_b9jyawkw1" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"const cursor = db.collection('inventory').find({\n dim_cm: { $gt: 25 }\n});","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> cursor <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">collection</span>(<span class="lg-highlight-string">'inventory'</span>).<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dim_cm</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">25</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-286-menu" aria-describedby="select-286-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-287" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlg:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlg:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlg:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlg:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_szf4vw1vy" class="leafygreen-ui-38lglc" id="_ngu607hlv" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;coll(\"inventory\")-&gt;find( { \"dim_cm\" =&gt; { '$gt' =&gt; 25 } } );","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor<!-- --> <!-- -->= <!-- -->$db<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">coll</span>(<span class="lg-highlight-string">"inventory"</span>)<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-string">"dim_cm"</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-string">'$gt'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">25</span> } } )<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-289-menu" aria-describedby="select-289-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-290" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlh:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlh:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlh:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlh:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_wwgox81h5" class="leafygreen-ui-38lglc" id="_5hqp7iec9" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;inventory-&gt;find(['dim_cm' =&gt; ['$gt' =&gt; 25]]);","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor = $db-&gt;inventory-&gt;<span class="lg-highlight-title lg-highlight-function">find</span>([<!-- --><span class="lg-highlight-string">'dim_cm'</span> =&gt; [<span class="lg-highlight-string">'$gt'</span> =&gt; <span class="lg-highlight-number">25</span>]]);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-292-menu" aria-describedby="select-292-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-293" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rli:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rli:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rli:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rli:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_g0va3cfvl" class="leafygreen-ui-38lglc" id="_yoql0cg39" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"dim_cm\": {\"$gt\": 25}})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"dim_cm"</span>: {<span class="lg-highlight-string">"$gt"</span>: <span class="lg-highlight-number">25</span>}})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-295-menu" aria-describedby="select-295-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-296" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlj:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlj:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlj:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlj:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_rjacv565g" class="leafygreen-ui-38lglc" id="_tll1ebt1t" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client[:inventory].find(dim_cm: { '$gt' =&gt; 25 })","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client<!-- -->[<!-- -->:inventory].<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-attr">dim_cm</span>: <!-- -->{ <span class="lg-highlight-string">'$gt'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">25</span> })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-298-menu" aria-describedby="select-298-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-299" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlk:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlk:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlk:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlk:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_62c82maky" class="leafygreen-ui-38lglc" id="_6b5ondocq" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findObservable = collection.find(gt(\"dim_cm\", 25))","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findObservable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">gt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">25</span>))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-301-menu" aria-describedby="select-301-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-302" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rll:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rll:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rll:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rll:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-specify-multiple-criteria-for-array-elements"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Specify Multiple Conditions for Array Elements <a class="headerlink leafygreen-ui-1kepx47" href="#specify-multiple-conditions-for-array-elements" 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="specify-multiple-conditions-for-array-elements"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> When specifying compound conditions on array elements, you can specify the query such that either a single array element meets these condition or any combination of array elements meets the conditions. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-combination-of-elements-satisfies-criteria"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Query an Array with Compound Filter Conditions on the Array Elements <a class="headerlink leafygreen-ui-1kepx47" href="#query-an-array-with-compound-filter-conditions-on-the-array-elements" 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="query-an-array-with-compound-filter-conditions-on-the-array-elements"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example queries for documents where the <code class="leafygreen-ui-1l06pbn"> dim_cm </code> array contains elements that in some combination satisfy the query conditions; e.g., one element can satisfy the greater than <code class="leafygreen-ui-1l06pbn"> 15 </code> condition and another element can satisfy the less than <code class="leafygreen-ui-1l06pbn"> 20 </code> condition, or a single element can satisfy both: </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-17"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_zowmsfeyk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0usllv8f7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_k5ouvmss5" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ljw5vvw40" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_jnum2vbrv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_1v39drhu1" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_137vxhh5b" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_hzosbufyz" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_7118tdgsw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_1ycabhvkk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_o09amsuvy" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_7gilcqfah" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_rim8vtguk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ja2dob0q4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_rov8oowsa" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_27qahftni" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_o1jlbqwhk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_z68a6jqne" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_vz3v4qz1k" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_9he9rs34g" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_jakjgx2wt" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ce9dhjvdv" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_mq59v7v2z" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_e175yhhdv" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_slwp0v6ps" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tot7hs26f" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_9drb555hn" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_p6bfs7baf" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_4gylsrcfb" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_j6mdbl42e" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_4gein73jb" class="leafygreen-ui-38lglc" id="_kxelet5lc" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find( { dim_cm: { $gt: 15, $lt: 20 } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">dim_cm</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">15</span>, <span class="lg-highlight-attr">$lt</span>: <span class="lg-highlight-number">20</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-304-menu" aria-describedby="select-304-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-305" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlm:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlm:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlm:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlm:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_un2mydi80" class="leafygreen-ui-38lglc" id="_kezzvpky1" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> Copy the following filter into the Compass query bar and click <span class="guilabel css-h15tq0"> Find </span> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ dim_cm: { $gt: 15, $lt: 20 } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">dim_cm</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">15</span>, <span class="lg-highlight-attr">$lt</span>: <span class="lg-highlight-number">20</span> } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-307-menu" aria-describedby="select-307-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-308" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rln:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rln:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rln:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rln:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:773px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='724.0000000000001'%20width='773'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Query array using a compound filter" data-main-image="" decoding="async" height="724.0000000000001" loading="lazy" sizes="(min-width: 773px) 773px, 100vw" src="/docs/manual/static/93635608ecbf927fedea2415a8717631/6d70b/compass-array-compound-filter.webp" srcset="/docs/manual/static/93635608ecbf927fedea2415a8717631/044bb/compass-array-compound-filter.webp 193w,/docs/manual/static/93635608ecbf927fedea2415a8717631/0416d/compass-array-compound-filter.webp 387w,/docs/manual/static/93635608ecbf927fedea2415a8717631/6d70b/compass-array-compound-filter.webp 773w" style="--border-color:#C1C7C6;opacity:0" width="773"/> <noscript> <img alt="Query array using a compound filter" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="724.0000000000001" loading="lazy" sizes="(min-width: 773px) 773px, 100vw" src="/docs/manual/static/93635608ecbf927fedea2415a8717631/6d70b/compass-array-compound-filter.webp" srcset="/docs/manual/static/93635608ecbf927fedea2415a8717631/044bb/compass-array-compound-filter.webp 193w,/docs/manual/static/93635608ecbf927fedea2415a8717631/0416d/compass-array-compound-filter.webp 387w,/docs/manual/static/93635608ecbf927fedea2415a8717631/6d70b/compass-array-compound-filter.webp 773w" style="--border-color:#C1C7C6;opacity:0" width="773"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_7mkkjbj9m" class="leafygreen-ui-38lglc" id="_dk4az6zqe" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongoc_collection_t *collection;\nbson_t *filter;\nmongoc_cursor_t *cursor;\n\ncollection = mongoc_database_get_collection (db, \"inventory\");\nfilter = BCON_NEW (\n \"dim_cm\", \"{\",\n \"$gt\", BCON_INT64 (15),\n \"$lt\", BCON_INT64 (20),\n \"}\");\ncursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongoc_collection_t *collection;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *filter;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongoc_cursor_t *cursor;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection <!-- -->= <!-- -->mongoc_database_get_collection (db<!-- -->, <span class="lg-highlight-string">"inventory"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">filter <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$gt"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">15</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$lt"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">20</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">cursor <!-- -->= <!-- -->mongoc_collection_find_with_opts (collection, filter<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-310-menu" aria-describedby="select-310-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-311" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlo:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlo:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlo:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlo:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_gkjewcs1v" class="leafygreen-ui-38lglc" id="_rw0pg3diq" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var builder = Builders&lt;bsondocument&gt;.Filter;\nvar filter = builder.And(builder.Gt(\"dim_cm\", 15), builder.Lt(\"dim_cm\", 20));\nvar result = collection.Find(filter).ToList();","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> builder = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> filter = builder.<span class="lg-highlight-title lg-highlight-class">And</span>(builder.<span class="lg-highlight-title lg-highlight-class">Gt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">15</span>), builder.<span class="lg-highlight-title lg-highlight-class">Lt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">20</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> result = collection.<span class="lg-highlight-title lg-highlight-class">Find</span>(filter).<span class="lg-highlight-title lg-highlight-class">ToList</span>();</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-313-menu" aria-describedby="select-313-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-314" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlp:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlp:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlp:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlp:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_nj04v90x5" class="leafygreen-ui-38lglc" id="_hf7ozmbh4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\ncursor, err := coll.Find(\n\tcontext.TODO(),\n\tbson.D{\n\t\t{\"dim_cm\", bson.D{\n\t\t\t{\"$gt\", 15},\n\t\t\t{\"$lt\", 20},\n\t\t}},\n\t})\n","programmingLanguage":"Golang"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor<!-- -->, <!-- -->err := coll.<span class="lg-highlight-title lg-highlight-class">Find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> context.<span class="lg-highlight-title lg-highlight-function">TODO</span>(),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"dim_cm"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$gt"</span>, <span class="lg-highlight-number">15</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$lt"</span>, <span class="lg-highlight-number">20</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-316-menu" aria-describedby="select-316-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-317" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlq:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlq:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlq:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlq:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_71cxx20qb" class="leafygreen-ui-38lglc" id="_mos9xvlbb" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findPublisher = collection.find(and(gt(\"dim_cm\", 15), lt(\"dim_cm\", 20)));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findPublisher = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">and</span>(<span class="lg-highlight-title lg-highlight-function">gt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">15</span>), <span class="lg-highlight-title lg-highlight-function">lt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">20</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-319-menu" aria-describedby="select-319-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-320" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlr:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlr:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlr:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlr:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_zfhtppb9z" class="leafygreen-ui-38lglc" id="_bm20l9kbo" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findIterable = collection.find(and(gt(\"dim_cm\", 15), lt(\"dim_cm\", 20)));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findIterable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">and</span>(<span class="lg-highlight-title lg-highlight-function">gt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">15</span>), <span class="lg-highlight-title lg-highlight-function">lt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">20</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-322-menu" aria-describedby="select-322-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-323" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rls:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rls:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rls:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rls:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_5gnf8ip6c" class="leafygreen-ui-38lglc" id="_3pnscwbwn" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"val findFlow = collection\n .find(and(gt(\"dim_cm\", 15), lt(\"dim_cm\", 20)))","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">val findFlow = collection</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">and</span>(<span class="lg-highlight-title lg-highlight-function">gt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">15</span>), <span class="lg-highlight-title lg-highlight-function">lt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">20</span>)))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-325-menu" aria-describedby="select-325-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-326" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlt:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlt:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlt:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlt:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_l1cqwhzwj" class="leafygreen-ui-38lglc" id="_vikcraxqa" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"dim_cm\": {\"$gt\": 15, \"$lt\": 20}})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"dim_cm"</span>: {<span class="lg-highlight-string">"$gt"</span>: <span class="lg-highlight-number">15</span>, <span class="lg-highlight-string">"$lt"</span>: <span class="lg-highlight-number">20</span>}})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-328-menu" aria-describedby="select-328-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-329" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlu:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlu:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlu:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlu:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_wwput0kkd" class="" id="_t1c51ficb" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"const cursor = db.collection('inventory').find({\n dim_cm: { $gt: 15, $lt: 20 }\n});","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> cursor <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">collection</span>(<span class="lg-highlight-string">'inventory'</span>).<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dim_cm</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">15</span>, <span class="lg-highlight-attr">$lt</span>: <span class="lg-highlight-number">20</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-331-menu" aria-describedby="select-331-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-332" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rlv:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rlv:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlv:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rlv:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_qowyckgxr" class="leafygreen-ui-38lglc" id="_d4xx03np4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;coll(\"inventory\")-&gt;find(\n { \"dim_cm\" =&gt; { '$gt' =&gt; 15, '$lt' =&gt; 20 } }\n);","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor<!-- --> <!-- -->= <!-- -->$db<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">coll</span>(<span class="lg-highlight-string">"inventory"</span>)<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"dim_cm"</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-string">'$gt'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">15</span>, <span class="lg-highlight-string">'$lt'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">20</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-334-menu" aria-describedby="select-334-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-335" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rm0:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rm0:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm0:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm0:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_6yx7gkob2" class="leafygreen-ui-38lglc" id="_tklmt3sg1" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;inventory-&gt;find([\n 'dim_cm' =&gt; [\n '$gt' =&gt; 15,\n '$lt' =&gt; 20,\n ],\n]);","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor = $db-&gt;inventory-&gt;<span class="lg-highlight-title lg-highlight-function">find</span>([</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'dim_cm'</span> =&gt; [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$gt'</span> =&gt; <span class="lg-highlight-number">15</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$lt'</span> =&gt; <span class="lg-highlight-number">20</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-337-menu" aria-describedby="select-337-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-338" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rm1:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rm1:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm1:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm1:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_ka7ddsnsl" class="leafygreen-ui-38lglc" id="_yajmgtm3y" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"dim_cm\": {\"$gt\": 15, \"$lt\": 20}})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"dim_cm"</span>: {<span class="lg-highlight-string">"$gt"</span>: <span class="lg-highlight-number">15</span>, <span class="lg-highlight-string">"$lt"</span>: <span class="lg-highlight-number">20</span>}})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-340-menu" aria-describedby="select-340-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-341" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rm2:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rm2:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm2:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm2:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_44qicy6dk" class="leafygreen-ui-38lglc" id="_0nhgk2urt" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client[:inventory].find(dim_cm: { '$gt' =&gt; 15,\n '$lt' =&gt; 20 })","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client<!-- -->[<!-- -->:inventory].<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-attr">dim_cm</span>: <!-- -->{ <span class="lg-highlight-string">'$gt'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">15</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$lt'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">20</span> })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-343-menu" aria-describedby="select-343-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-344" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rm3:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rm3:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm3:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm3:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_wdu2f1tgz" class="leafygreen-ui-38lglc" id="_9zcp7qgi8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findObservable = collection.find(and(gt(\"dim_cm\", 15), lt(\"dim_cm\", 20)))","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findObservable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">and</span>(<span class="lg-highlight-title lg-highlight-function">gt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">15</span>), <span class="lg-highlight-title lg-highlight-function">lt</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-number">20</span>)))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-346-menu" aria-describedby="select-346-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-347" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rm4:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rm4:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm4:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm4:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-single-element-satisfies-criteria"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Query for an Array Element that Meets Multiple Criteria <a class="headerlink leafygreen-ui-1kepx47" href="#query-for-an-array-element-that-meets-multiple-criteria" 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="query-for-an-array-element-that-meets-multiple-criteria"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/elemMatch/#mongodb-query-op.-elemMatch"> <code class="leafygreen-ui-1l06pbn"> $elemMatch </code> </a> operator to specify multiple criteria on the elements of an array such that at least one array element satisfies all the specified criteria. </p> <p class="leafygreen-ui-1kp3ins"> The following example queries for documents where the <code class="leafygreen-ui-1l06pbn"> dim_cm </code> array contains at least one element that is both greater than ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/gt/#mongodb-query-op.-gt"> <code class="leafygreen-ui-1l06pbn"> $gt </code> </a> ) <code class="leafygreen-ui-1l06pbn"> 22 </code> and less than ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/lt/#mongodb-query-op.-lt"> <code class="leafygreen-ui-1l06pbn"> $lt </code> </a> ) <code class="leafygreen-ui-1l06pbn"> 30 </code> : </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-19"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_vkqmodaoh" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_y0klqde52" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_sit91f0le" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_sl659jpr3" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_gf7q2heru" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_11s7h6z4u" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_dzdo6e20n" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_rujh1thde" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_rmwafmjgl" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tz7zy1gti" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_zju8g6i4b" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_o1b2znbup" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_vwemmn3h2" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_xh3j8n78b" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_0mvpgs80g" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_hlog4107c" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_lvlm5mfj2" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tneupvlus" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_mva4gm90m" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_jr2g0kmh6" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_wcjumr79m" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_bhbt6nxem" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_izbcrudll" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fbv7f15xt" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_rru881iic" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_icgu68v6v" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_btceygc2h" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9ml3jqln4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_8w2dsamsp" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_c94wj8zxp" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_1zlp4mzfp" class="leafygreen-ui-38lglc" id="_ndo113s5n" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find( { dim_cm: { $elemMatch: { $gt: 22, $lt: 30 } } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">dim_cm</span>: <!-- -->{ <span class="lg-highlight-attr">$elemMatch</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">22</span>, <span class="lg-highlight-attr">$lt</span>: <span class="lg-highlight-number">30</span> } } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-349-menu" aria-describedby="select-349-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-350" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rm5:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rm5:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm5:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm5:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_6kv0h5iuw" class="leafygreen-ui-38lglc" id="_f6ar9ejoq" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> Copy the following filter into the Compass query bar and click <span class="guilabel css-h15tq0"> Find </span> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ dim_cm: { $elemMatch: { $gt: 22, $lt: 30 } } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">dim_cm</span>: <!-- -->{ <span class="lg-highlight-attr">$elemMatch</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">22</span>, <span class="lg-highlight-attr">$lt</span>: <span class="lg-highlight-number">30</span> } } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-352-menu" aria-describedby="select-352-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-353" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rm6:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rm6:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm6:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm6:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:772px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='306'%20width='772'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Query array by multiple conditions" data-main-image="" decoding="async" height="306" loading="lazy" sizes="(min-width: 772px) 772px, 100vw" src="/docs/manual/static/db8b8b6e0b1c22ac416d5b2dc45712e6/40717/compass-array-compound-multiple-criteria.webp" srcset="/docs/manual/static/db8b8b6e0b1c22ac416d5b2dc45712e6/9a120/compass-array-compound-multiple-criteria.webp 193w,/docs/manual/static/db8b8b6e0b1c22ac416d5b2dc45712e6/1d2f9/compass-array-compound-multiple-criteria.webp 386w,/docs/manual/static/db8b8b6e0b1c22ac416d5b2dc45712e6/40717/compass-array-compound-multiple-criteria.webp 772w" style="--border-color:#C1C7C6;opacity:0" width="772"/> <noscript> <img alt="Query array by multiple conditions" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="306" loading="lazy" sizes="(min-width: 772px) 772px, 100vw" src="/docs/manual/static/db8b8b6e0b1c22ac416d5b2dc45712e6/40717/compass-array-compound-multiple-criteria.webp" srcset="/docs/manual/static/db8b8b6e0b1c22ac416d5b2dc45712e6/9a120/compass-array-compound-multiple-criteria.webp 193w,/docs/manual/static/db8b8b6e0b1c22ac416d5b2dc45712e6/1d2f9/compass-array-compound-multiple-criteria.webp 386w,/docs/manual/static/db8b8b6e0b1c22ac416d5b2dc45712e6/40717/compass-array-compound-multiple-criteria.webp 772w" style="--border-color:#C1C7C6;opacity:0" width="772"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_lisivq1or" class="leafygreen-ui-38lglc" id="_xfr7zmx4d" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongoc_collection_t *collection;\nbson_t *filter;\nmongoc_cursor_t *cursor;\n\ncollection = mongoc_database_get_collection (db, \"inventory\");\nfilter = BCON_NEW (\n \"dim_cm\", \"{\",\n \"$elemMatch\", \"{\",\n \"$gt\", BCON_INT64 (22),\n \"$lt\", BCON_INT64 (30),\n \"}\",\n \"}\");\ncursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongoc_collection_t *collection;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *filter;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongoc_cursor_t *cursor;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection <!-- -->= <!-- -->mongoc_database_get_collection (db<!-- -->, <span class="lg-highlight-string">"inventory"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">filter <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$elemMatch"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$gt"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">22</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$lt"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">30</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">cursor <!-- -->= <!-- -->mongoc_collection_find_with_opts (collection, filter<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-355-menu" aria-describedby="select-355-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-356" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rm7:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rm7:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm7:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm7:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_2qzyu695i" class="leafygreen-ui-38lglc" id="_riifihvbc" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var filter = Builders&lt;bsondocument&gt;.Filter.ElemMatch&lt;bsonvalue&gt;(\"dim_cm\", new BsonDocument { { \"$gt\", 22 }, { \"$lt\", 30 } });\nvar result = collection.Find(filter).ToList();","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> filter = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>.<span class="lg-highlight-property">ElemMatch</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonValue</span>&gt;(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span> { { <span class="lg-highlight-string">"$gt"</span>, <span class="lg-highlight-number">22</span> }, { <span class="lg-highlight-string">"$lt"</span>, <span class="lg-highlight-number">30</span> } });</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> result = collection.<span class="lg-highlight-title lg-highlight-class">Find</span>(filter).<span class="lg-highlight-title lg-highlight-class">ToList</span>();</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-358-menu" aria-describedby="select-358-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-359" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rm8:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rm8:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm8:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm8:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_dy2moddgb" class="leafygreen-ui-38lglc" id="_k9wpvkrw3" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\ncursor, err := coll.Find(\n\tcontext.TODO(),\n\tbson.D{\n\t\t{\"dim_cm\", bson.D{\n\t\t\t{\"$elemMatch\", bson.D{\n\t\t\t\t{\"$gt\", 22},\n\t\t\t\t{\"$lt\", 30},\n\t\t\t}},\n\t\t}},\n\t})\n","programmingLanguage":"Golang"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor<!-- -->, <!-- -->err := coll.<span class="lg-highlight-title lg-highlight-class">Find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> context.<span class="lg-highlight-title lg-highlight-function">TODO</span>(),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"dim_cm"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$elemMatch"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$gt"</span>, <span class="lg-highlight-number">22</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$lt"</span>, <span class="lg-highlight-number">30</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-361-menu" aria-describedby="select-361-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-362" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rm9:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rm9:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm9:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rm9:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_qxqmgh6gy" class="leafygreen-ui-38lglc" id="_2iql34n6v" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findPublisher = collection.find(elemMatch(\"dim_cm\", Document.parse(\"{ $gt: 22, $lt: 30 }\")));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findPublisher = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">elemMatch</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ $gt: 22, $lt: 30 }"</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-364-menu" aria-describedby="select-364-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-365" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rma:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rma:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rma:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rma:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_dnm55m4kx" class="leafygreen-ui-38lglc" id="_srkedlc6b" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findIterable = collection.find(elemMatch(\"dim_cm\", Document.parse(\"{ $gt: 22, $lt: 30 }\")));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findIterable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">elemMatch</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ $gt: 22, $lt: 30 }"</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-367-menu" aria-describedby="select-367-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-368" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmb:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmb:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmb:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmb:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_vgxpg2b00" class="leafygreen-ui-38lglc" id="_h3z8x8368" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"val findFlow = collection\n .find(elemMatch(\"dim_cm\", Document.parse(\"{ \\$gt: 22, \\$lt: 30 }\")))","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">val findFlow = collection</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">elemMatch</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ </span><span class="lg-highlight-string">\$</span><span class="lg-highlight-string">gt: 22, </span><span class="lg-highlight-string">\$</span><span class="lg-highlight-string">lt: 30 }"</span>)))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-370-menu" aria-describedby="select-370-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-371" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmc:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmc:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmc:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmc:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_fbxt5f8h5" class="leafygreen-ui-38lglc" id="_w3q4mck26" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"dim_cm\": {\"$elemMatch\": {\"$gt\": 22, \"$lt\": 30}}})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"dim_cm"</span>: {<span class="lg-highlight-string">"$elemMatch"</span>: {<span class="lg-highlight-string">"$gt"</span>: <span class="lg-highlight-number">22</span>, <span class="lg-highlight-string">"$lt"</span>: <span class="lg-highlight-number">30</span>}}})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-373-menu" aria-describedby="select-373-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-374" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmd:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmd:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmd:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmd:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_pbpsabuhm" class="" id="_8ea0z8uxx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"const cursor = db.collection('inventory').find({\n dim_cm: { $elemMatch: { $gt: 22, $lt: 30 } }\n});","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> cursor <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">collection</span>(<span class="lg-highlight-string">'inventory'</span>).<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dim_cm</span>: <!-- -->{ <span class="lg-highlight-attr">$elemMatch</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">22</span>, <span class="lg-highlight-attr">$lt</span>: <span class="lg-highlight-number">30</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-376-menu" aria-describedby="select-376-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-377" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rme:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rme:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rme:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rme:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_azqol18c0" class="leafygreen-ui-38lglc" id="_joe6qu389" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;coll(\"inventory\")-&gt;find(\n { dim_cm =&gt; { '$elemMatch' =&gt; { '$gt' =&gt; 22, '$lt' =&gt; 30 } } }\n);","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor<!-- --> <!-- -->= <!-- -->$db<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">coll</span>(<span class="lg-highlight-string">"inventory"</span>)<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-params lg-highlight-function">dim_cm</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <!-- -->{ <span class="lg-highlight-string">'$elemMatch'</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-string">'$gt'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">22</span>, <span class="lg-highlight-string">'$lt'</span> <!-- -->=&gt; <span class="lg-highlight-number">30</span> } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-379-menu" aria-describedby="select-379-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-380" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmf:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmf:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmf:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmf:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_k2iqmba9a" class="leafygreen-ui-38lglc" id="_bfxeavo9i" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;inventory-&gt;find([\n 'dim_cm' =&gt; [\n '$elemMatch' =&gt; [\n '$gt' =&gt; 22,\n '$lt' =&gt; 30,\n ],\n ],\n]);","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor = $db-&gt;inventory-&gt;<span class="lg-highlight-title lg-highlight-function">find</span>([</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'dim_cm'</span> =&gt; [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$elemMatch'</span> =&gt; [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$gt'</span> =&gt; <span class="lg-highlight-number">22</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$lt'</span> =&gt; <span class="lg-highlight-number">30</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-382-menu" aria-describedby="select-382-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-383" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmg:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmg:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmg:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmg:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_b3wo2farz" class="leafygreen-ui-38lglc" id="_c7uwnvorm" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"dim_cm\": {\"$elemMatch\": {\"$gt\": 22, \"$lt\": 30}}})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"dim_cm"</span>: {<span class="lg-highlight-string">"$elemMatch"</span>: {<span class="lg-highlight-string">"$gt"</span>: <span class="lg-highlight-number">22</span>, <span class="lg-highlight-string">"$lt"</span>: <span class="lg-highlight-number">30</span>}}})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-385-menu" aria-describedby="select-385-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-386" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmh:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmh:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmh:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmh:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_094y3vhvj" class="leafygreen-ui-38lglc" id="_q24etv3iw" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client[:inventory].find(dim_cm: { '$elemMatch' =&gt; { '$gt' =&gt; 22,\n '$lt' =&gt; 30 } })","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client<!-- -->[<!-- -->:inventory].<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-attr">dim_cm</span>: <!-- -->{ <span class="lg-highlight-string">'$elemMatch'</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-string">'$gt'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">22</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$lt'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">30</span> } })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-388-menu" aria-describedby="select-388-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-389" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmi:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmi:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmi:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmi:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_qlq84m03a" class="leafygreen-ui-38lglc" id="_4eruveohg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findObservable = collection.find(elemMatch(\"dim_cm\", Document(\"$gt\" -&gt; 22, \"$lt\" -&gt; 30)))\n","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findObservable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">elemMatch</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"$gt"</span> -&gt; <span class="lg-highlight-number">22</span>, <span class="lg-highlight-string">"$lt"</span> -&gt; <span class="lg-highlight-number">30</span>)))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-391-menu" aria-describedby="select-391-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-392" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmj:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmj:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmj:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmj:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Query for an Element by the Array Index Position <a class="headerlink leafygreen-ui-1kepx47" href="#query-for-an-element-by-the-array-index-position" 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="query-for-an-element-by-the-array-index-position"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-dot-notation"> dot notation </a> , you can specify query conditions for an element at a particular index or position of the array. The array uses zero-based indexing. </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"> When querying using dot notation, the field and nested field must be inside quotation marks. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example queries for all documents where the second element in the array <code class="leafygreen-ui-1l06pbn"> dim_cm </code> is greater than <code class="leafygreen-ui-1l06pbn"> 25 </code> : </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-21"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_97a6a43b0" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_isrrvtqpl" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_g6f70wnip" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_atqc8ysmy" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_x79lj1fhv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_wana3x1ig" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_h8a92f50u" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_6tsxf22bt" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_kshevto5v" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_avdz80anu" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_28z1qp1e5" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_m3md5onex" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_rd5aahaam" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_qxj4vnfz4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_cqhoianzi" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_unpyj910i" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_fztkvl71t" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_madnuvopf" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_ckdbj4u1s" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_aep4488by" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_dz8dnckvu" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0w6sm5jfm" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_ru5299e1a" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_f4ae8el14" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_cr6dsf63d" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_7ytbwu0ur" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_kfn6kunpd" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_3zsn92v47" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_rgs6d96rx" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fn9w0hnhf" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_q48wy8pdu" class="leafygreen-ui-38lglc" id="_stmloh75z" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find( { \"dim_cm.1\": { $gt: 25 } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-string">"dim_cm.1"</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">25</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-394-menu" aria-describedby="select-394-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-395" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmk:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmk:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmk:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmk:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_xresoyq7y" class="leafygreen-ui-38lglc" id="_1rgb35ztj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> Copy the following filter into the Compass query bar and click <span class="guilabel css-h15tq0"> Find </span> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"dim_cm.1\": { $gt: 25 } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"dim_cm.1"</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">25</span> } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-397-menu" aria-describedby="select-397-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-398" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rml:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rml:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rml:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rml:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:773px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='306'%20width='773'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Query array by index" data-main-image="" decoding="async" height="306" loading="lazy" sizes="(min-width: 773px) 773px, 100vw" src="/docs/manual/static/a414aa431749d18d74fc19625c980812/f3ba0/compass-array-match-by-index.webp" srcset="/docs/manual/static/a414aa431749d18d74fc19625c980812/60c2d/compass-array-match-by-index.webp 193w,/docs/manual/static/a414aa431749d18d74fc19625c980812/7339a/compass-array-match-by-index.webp 387w,/docs/manual/static/a414aa431749d18d74fc19625c980812/f3ba0/compass-array-match-by-index.webp 773w" style="--border-color:#C1C7C6;opacity:0" width="773"/> <noscript> <img alt="Query array by index" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="306" loading="lazy" sizes="(min-width: 773px) 773px, 100vw" src="/docs/manual/static/a414aa431749d18d74fc19625c980812/f3ba0/compass-array-match-by-index.webp" srcset="/docs/manual/static/a414aa431749d18d74fc19625c980812/60c2d/compass-array-match-by-index.webp 193w,/docs/manual/static/a414aa431749d18d74fc19625c980812/7339a/compass-array-match-by-index.webp 387w,/docs/manual/static/a414aa431749d18d74fc19625c980812/f3ba0/compass-array-match-by-index.webp 773w" style="--border-color:#C1C7C6;opacity:0" width="773"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ejb6dhab8" class="leafygreen-ui-38lglc" id="_xthpzsjtd" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongoc_collection_t *collection;\nbson_t *filter;\nmongoc_cursor_t *cursor;\n\ncollection = mongoc_database_get_collection (db, \"inventory\");\nfilter = BCON_NEW (\n \"dim_cm.1\", \"{\",\n \"$gt\", BCON_INT64 (25),\n \"}\");\ncursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongoc_collection_t *collection;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *filter;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongoc_cursor_t *cursor;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection <!-- -->= <!-- -->mongoc_database_get_collection (db<!-- -->, <span class="lg-highlight-string">"inventory"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">filter <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dim_cm.1"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$gt"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">25</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">cursor <!-- -->= <!-- -->mongoc_collection_find_with_opts (collection, filter<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-400-menu" aria-describedby="select-400-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-401" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmm:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmm:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmm:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmm:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_pm62l3pph" class="leafygreen-ui-38lglc" id="_hswjjh5j8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var filter = Builders&lt;bsondocument&gt;.Filter.Gt(\"dim_cm.1\", 25);\nvar result = collection.Find(filter).ToList();","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> filter = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>.<span class="lg-highlight-title lg-highlight-class">Gt</span>(<span class="lg-highlight-string">"dim_cm.1"</span>, <span class="lg-highlight-number">25</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> result = collection.<span class="lg-highlight-title lg-highlight-class">Find</span>(filter).<span class="lg-highlight-title lg-highlight-class">ToList</span>();</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-403-menu" aria-describedby="select-403-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-404" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmn:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmn:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmn:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmn:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_tr39g1suo" class="leafygreen-ui-38lglc" id="_tzi8f0i9g" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\ncursor, err := coll.Find(\n\tcontext.TODO(),\n\tbson.D{\n\t\t{\"dim_cm.1\", bson.D{\n\t\t\t{\"$gt\", 25},\n\t\t}},\n\t})\n","programmingLanguage":"Golang"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor<!-- -->, <!-- -->err := coll.<span class="lg-highlight-title lg-highlight-class">Find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> context.<span class="lg-highlight-title lg-highlight-function">TODO</span>(),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"dim_cm.1"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$gt"</span>, <span class="lg-highlight-number">25</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-406-menu" aria-describedby="select-406-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-407" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmo:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmo:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmo:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmo:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_vyfmiz9l7" class="leafygreen-ui-38lglc" id="_zkcrsrp2q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findPublisher = collection.find(elemMatch(\"dim_cm\", Document.parse(\"{ $gt: 22, $lt: 30 }\")));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findPublisher = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">elemMatch</span>(<span class="lg-highlight-string">"dim_cm"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ $gt: 22, $lt: 30 }"</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-409-menu" aria-describedby="select-409-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-410" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmp:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmp:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmp:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmp:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_ch0jtidrf" class="leafygreen-ui-38lglc" id="_qqs9ukwc7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findIterable = collection.find(gt(\"dim_cm.1\", 25));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findIterable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">gt</span>(<span class="lg-highlight-string">"dim_cm.1"</span>, <span class="lg-highlight-number">25</span>));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-412-menu" aria-describedby="select-412-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-413" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmq:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmq:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmq:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmq:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_2bv5q0406" class="leafygreen-ui-38lglc" id="_lqq0hvylu" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"val findFlow = collection\n .find(gt(\"dim_cm.1\", 25))","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">val findFlow = collection</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">gt</span>(<span class="lg-highlight-string">"dim_cm.1"</span>, <span class="lg-highlight-number">25</span>))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-415-menu" aria-describedby="select-415-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-416" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmr:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmr:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmr:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmr:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_u4x36ieas" class="leafygreen-ui-38lglc" id="_7vflpu83v" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"dim_cm.1\": {\"$gt\": 25}})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"dim_cm.1"</span>: {<span class="lg-highlight-string">"$gt"</span>: <span class="lg-highlight-number">25</span>}})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-418-menu" aria-describedby="select-418-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-419" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rms:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rms:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rms:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rms:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_xs8h8yjzz" class="" id="_q0cyiqzb5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"const cursor = db.collection('inventory').find({\n 'dim_cm.1': { $gt: 25 }\n});","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> cursor <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">collection</span>(<span class="lg-highlight-string">'inventory'</span>).<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'dim_cm.1'</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">25</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-421-menu" aria-describedby="select-421-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-422" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmt:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmt:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmt:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmt:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_ymcgdr2kh" class="leafygreen-ui-38lglc" id="_hs939i13z" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;coll(\"inventory\")-&gt;find( { \"dim_cm.1\" =&gt; { '$gt' =&gt; 25 } } );","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor<!-- --> <!-- -->= <!-- -->$db<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">coll</span>(<span class="lg-highlight-string">"inventory"</span>)<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-string">"dim_cm.1"</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-string">'$gt'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">25</span> } } )<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-424-menu" aria-describedby="select-424-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-425" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmu:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmu:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmu:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmu:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_d03hwgfv4" class="leafygreen-ui-38lglc" id="_mnfdm3r48" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;inventory-&gt;find(['dim_cm.1' =&gt; ['$gt' =&gt; 25]]);","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor = $db-&gt;inventory-&gt;<span class="lg-highlight-title lg-highlight-function">find</span>([<!-- --><span class="lg-highlight-string">'dim_cm.1'</span> =&gt; [<span class="lg-highlight-string">'$gt'</span> =&gt; <span class="lg-highlight-number">25</span>]]);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-427-menu" aria-describedby="select-427-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-428" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rmv:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rmv:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmv:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rmv:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_gvq2ox1hf" class="leafygreen-ui-38lglc" id="_lc1mxib8n" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"dim_cm.1\": {\"$gt\": 25}})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"dim_cm.1"</span>: {<span class="lg-highlight-string">"$gt"</span>: <span class="lg-highlight-number">25</span>}})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-430-menu" aria-describedby="select-430-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-431" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rn0:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rn0:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn0:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn0:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_7v29ryk3w" class="leafygreen-ui-38lglc" id="_lg7zbbj4u" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client[:inventory].find('dim_cm.1' =&gt; { '$gt' =&gt; 25 })","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client<!-- -->[<!-- -->:inventory].<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-string">'dim_cm.1'</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-string">'$gt'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">25</span> })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-433-menu" aria-describedby="select-433-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-434" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rn1:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rn1:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn1:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn1:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_ctlj5awwh" class="leafygreen-ui-38lglc" id="_k6ypxaws4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findObservable = collection.find(gt(\"dim_cm.1\", 25))","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findObservable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">gt</span>(<span class="lg-highlight-string">"dim_cm.1"</span>, <span class="lg-highlight-number">25</span>))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-436-menu" aria-describedby="select-436-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-437" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rn2:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rn2:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn2:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn2:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Query an Array by Array Length <a class="headerlink leafygreen-ui-1kepx47" href="#query-an-array-by-array-length" 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="query-an-array-by-array-length"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/size/#mongodb-query-op.-size"> <code class="leafygreen-ui-1l06pbn"> $size </code> </a> operator to query for arrays by number of elements. For example, the following selects documents where the array <code class="leafygreen-ui-1l06pbn"> tags </code> has 3 elements. </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-23"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_qtcmr3qeo" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_nvtwzl10i" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_q6hyht9ts" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_suy31ieua" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_97wjlva6p" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_c7f9racw3" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_rn5gagi7h" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_8b33pi6iw" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_x8zu5xevb" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_7cs3pgqux" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_k9zjdy1tj" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2jryrxh5y" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_gcegw1ze9" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_e6qeelfc2" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_hyg0ncku5" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_o6oxhlhxp" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_wfettocb8" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_3bjybp7mb" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_0xg5m8nzn" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_fguiq29vx" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_z1w45vkhe" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_cxvlezvb7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_g6pph9pwf" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2ky5w6nrt" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_hc952t4j5" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9nk5uhpt9" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_uf3ew69a5" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_36m4samv9" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_7k8j1yd6b" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_rcd2l1byb" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_wdrb5vq4t" class="leafygreen-ui-38lglc" id="_awe8amgr3" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find( { \"tags\": { $size: 3 } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-string">"tags"</span>: <!-- -->{ <span class="lg-highlight-attr">$size</span>: <span class="lg-highlight-number">3</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-439-menu" aria-describedby="select-439-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-440" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rn3:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rn3:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn3:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn3:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_bdgyfe4bm" class="leafygreen-ui-38lglc" id="_web741qbn" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> Copy the following filter into the Compass query bar and click <span class="guilabel css-h15tq0"> Find </span> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"tags\": { $size: 3 } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"tags"</span>: <!-- -->{ <span class="lg-highlight-attr">$size</span>: <span class="lg-highlight-number">3</span> } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-442-menu" aria-describedby="select-442-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-443" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rn4:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rn4:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn4:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn4:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_s57pjjdyk" class="leafygreen-ui-38lglc" id="_2qgsvj19q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongoc_collection_t *collection;\nbson_t *filter;\nmongoc_cursor_t *cursor;\n\ncollection = mongoc_database_get_collection (db, \"inventory\");\nfilter = BCON_NEW (\n \"tags\", \"{\",\n \"$size\", BCON_INT64 (3),\n \"}\");\ncursor = mongoc_collection_find_with_opts (collection, filter, NULL, NULL);","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongoc_collection_t *collection;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *filter;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongoc_cursor_t *cursor;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection <!-- -->= <!-- -->mongoc_database_get_collection (db<!-- -->, <span class="lg-highlight-string">"inventory"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">filter <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$size"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">3</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">cursor <!-- -->= <!-- -->mongoc_collection_find_with_opts (collection, filter<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-445-menu" aria-describedby="select-445-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-446" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rn5:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rn5:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn5:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn5:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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"> Be sure to also clean up any open resources by calling the following methods, as appropriate: </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="http://mongoc.org/libbson/current/bson_destroy.html" rel="noopener noreferrer"> <span> bson_destroy </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongoc.org/libmongoc/current/mongoc_bulk_operation_destroy.html" rel="noopener noreferrer"> <span> mongoc_bulk_operation_destroy </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongoc.org/libmongoc/current/mongoc_collection_destroy" rel="noopener noreferrer"> <span> mongoc_collection_destroy </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongoc.org/libmongoc/current/mongoc_cursor_destroy.html" rel="noopener noreferrer"> <span> mongoc_cursor_destroy <!-- --> , </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> </div> </div> </div> <div> <div aria-labelledby="_5gdfe4m1y" class="leafygreen-ui-38lglc" id="_q8ujknywl" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var filter = Builders&lt;bsondocument&gt;.Filter.Size(\"tags\", 3);\nvar result = collection.Find(filter).ToList();","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> filter = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>.<span class="lg-highlight-title lg-highlight-class">Size</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-number">3</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> result = collection.<span class="lg-highlight-title lg-highlight-class">Find</span>(filter).<span class="lg-highlight-title lg-highlight-class">ToList</span>();</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-448-menu" aria-describedby="select-448-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-449" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rn6:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rn6:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn6:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn6:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_c5o7wi725" class="leafygreen-ui-38lglc" id="_czbt3jo8o" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\ncursor, err := coll.Find(\n\tcontext.TODO(),\n\tbson.D{\n\t\t{\"tags\", bson.D{\n\t\t\t{\"$size\", 3},\n\t\t}},\n\t})\n","programmingLanguage":"Golang"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor<!-- -->, <!-- -->err := coll.<span class="lg-highlight-title lg-highlight-class">Find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> context.<span class="lg-highlight-title lg-highlight-function">TODO</span>(),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"tags"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$size"</span>, <span class="lg-highlight-number">3</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-451-menu" aria-describedby="select-451-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-452" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rn7:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rn7:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn7:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn7:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_x0pswgkmp" class="leafygreen-ui-38lglc" id="_aafy82wou" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findPublisher = collection.find(size(\"tags\", 3));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findPublisher = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">size</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-number">3</span>));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-454-menu" aria-describedby="select-454-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-455" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rn8:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rn8:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn8:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn8:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_0ng37t2cl" class="leafygreen-ui-38lglc" id="_9rfkd04nm" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findIterable = collection.find(size(\"tags\", 3));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findIterable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">size</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-number">3</span>));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-457-menu" aria-describedby="select-457-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-458" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rn9:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rn9:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn9:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rn9:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_m01quk779" class="leafygreen-ui-38lglc" id="_lzduwhjk7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"val findFlow = collection\n .find(size(\"tags\", 3))","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">val findFlow = collection</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">size</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-number">3</span>))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-460-menu" aria-describedby="select-460-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-461" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rna:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rna:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rna:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rna:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_iuxafe5yq" class="leafygreen-ui-38lglc" id="_r5g4zdpg5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"tags\": {\"$size\": 3}})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"tags"</span>: {<span class="lg-highlight-string">"$size"</span>: <span class="lg-highlight-number">3</span>}})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-463-menu" aria-describedby="select-463-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-464" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rnb:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rnb:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rnb:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rnb:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_zmttiz4rm" class="" id="_co6909y2o" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"const cursor = db.collection('inventory').find({\n tags: { $size: 3 }\n});","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> cursor <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">collection</span>(<span class="lg-highlight-string">'inventory'</span>).<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->{ <span class="lg-highlight-attr">$size</span>: <span class="lg-highlight-number">3</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-466-menu" aria-describedby="select-466-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-467" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rnc:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rnc:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rnc:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rnc:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_7sksl5nj6" class="leafygreen-ui-38lglc" id="_e79xcgpdh" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;coll(\"inventory\")-&gt;find( { tags =&gt; { '$size' =&gt; 3 } } );","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor<!-- --> <!-- -->= <!-- -->$db<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">coll</span>(<span class="lg-highlight-string">"inventory"</span>)<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-params lg-highlight-function">tags</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <!-- -->{ <span class="lg-highlight-string">'$size'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">3</span> } } );</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-469-menu" aria-describedby="select-469-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-470" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rnd:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rnd:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rnd:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rnd:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_zwbg9ckqw" class="leafygreen-ui-38lglc" id="_ynp0cic3q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$cursor = $db-&gt;inventory-&gt;find(['tags' =&gt; ['$size' =&gt; 3]]);","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$cursor = $db-&gt;inventory-&gt;<span class="lg-highlight-title lg-highlight-function">find</span>([<!-- --><span class="lg-highlight-string">'tags'</span> =&gt; [<span class="lg-highlight-string">'$size'</span> =&gt; <span class="lg-highlight-number">3</span>]]);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-472-menu" aria-describedby="select-472-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-473" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rne:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rne:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rne:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rne:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_yvt1op9ce" class="leafygreen-ui-38lglc" id="_pedq08nvr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cursor = db.inventory.find({\"tags\": {\"$size\": 3}})","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cursor = db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>({<span class="lg-highlight-string">"tags"</span>: {<span class="lg-highlight-string">"$size"</span>: <span class="lg-highlight-number">3</span>}})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-475-menu" aria-describedby="select-475-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-476" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rnf:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rnf:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rnf:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rnf:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_xr722vcmw" class="leafygreen-ui-38lglc" id="_z7x1amxj5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client[:inventory].find(tags: { '$size' =&gt; 3 })","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client<!-- -->[<!-- -->:inventory].<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-attr">tags</span>: <!-- -->{ <span class="lg-highlight-string">'$size'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">3</span> })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-478-menu" aria-describedby="select-478-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-479" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rng:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rng:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rng:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rng:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_2nozp74sy" class="leafygreen-ui-38lglc" id="_hnbwx6dur" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"findObservable = collection.find(size(\"tags\", 3))","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">findObservable = collection.<span class="lg-highlight-title lg-highlight-function">find</span>(<span class="lg-highlight-title lg-highlight-function">size</span>(<span class="lg-highlight-string">"tags"</span>, <span class="lg-highlight-number">3</span>))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-481-menu" aria-describedby="select-481-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-482" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rnh:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rnh:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rnh:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rnh:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-query-array-atlas-ui"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Query an Array with MongoDB Atlas <a class="headerlink leafygreen-ui-1kepx47" href="#query-an-array-with-mongodb-atlas" 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="query-an-array-with-mongodb-atlas"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The example in this section uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/sample-data/sample-mflix/" target="_self"> <span> sample movies dataset </span> </a> . To learn how to load the sample dataset into your MongoDB Atlas deployment, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/sample-data/#std-label-load-sample-data" target="_self"> <span> Load Sample Data <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> To query an array in MongoDB Atlas, follow these steps: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"If it's not already displayed, select the organization that\ncontains your desired project from the Organizations menu in the\nnavigation bar.If it's not already displayed, select your project\nfrom the Projects menu in the navigation bar.If it's not already displayed, click Clusters in the\nsidebar.The Clusters page displays.","name":"In the MongoDB Atlas UI, go to the Clusters page for your project."},{"@type":"HowToStep","text":"For the cluster that contains the sample data,\nclick Browse Collections.In the left navigation pane, select the\nsample_mflix database.Select the movies collection.","name":"Navigate to the collection."},{"@type":"HowToStep","text":"To query a document that contains an array,\nspecify a query filter document.\nA query filter document uses query operators to specify search conditions.\nUse the following example documents to query array fields in the\nsample_mflix.movies collection.To apply a query filter, copy an example document into the\nFilter search bar and click Apply.To specify an equality condition on an array, use the query\ndocument { <field>: <value> } where <value> is\nthe exact array to match, including the order of the elements.\nThe following example finds documents that have a genres\nfield that contains the [\"Action\", \"Comedy\"] array in the\nspecified order:To find an array that contains both the elements Action and\nComedy, without regard to order or other elements\nin the array, use the $all operator:To query if the array field contains at least one element with the\nspecified value, use the filter { <field>: <value> } where\n<value> is the element value.The following example queries for all documents where the\ngenres field contains the string Short as one\nof its elements:To specify conditions on the elements in the array field,\nuse query operators in the\nquery filter document:For example, the following operation uses the\n$nin operator to query for all documents\nwhere the genres field does not contain Drama.When specifying compound conditions on array elements, you can specify\nthe query such that either a single array element meets these condition\nor any combination of array elements meets the conditions.Query an Array with Compound Filter Conditions on the Array ElementsThe following example queries for documents where the cast\narray contains elements that in some combination satisfy the query\nconditions. For example, the following filter uses the $regex\nand $eq operators to return documents where a single array element\nends in Olsen and another element equals Mary-Kate Olsen or\na single element that satisfies both conditions:This query filter returns movies that include Mary-Kate Olsen in\ntheir cast, and movies that include both Mary-Kate Olsen and\nAshley Olsen in their cast.Query for an Array Element that Meets Multiple CriteriaUse $elemMatch operator to specify multiple criteria on the\nelements of an array such that at least one array element satisfies all\nthe specified criteria.The following example uses the $elemMatch and $ne\noperators to query for documents where the languages array contains\nat least one element that is both not null and does not equal English.Query for an Element by the Array Index PositionUsing dot notation, you can specify query conditions for an\nelement at a particular index or position of the array. The array uses\nzero-based indexing.When querying using dot notation, the field and nested field must be\ninside quotation marks.The following example uses the $ne operator to query\nfor all documents where the first element in the countries\narray is not equal to USA:Query an Array by Array LengthUse the $size operator to query for arrays by number of\nelements. For example, the following selects documents where the array\ngenres has 3 elements.","name":"Specify a query filter document."}],"name":"Query an Array with MongoDB Atlas","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> In the MongoDB Atlas UI, go to the <span class="guilabel css-h15tq0"> Clusters </span> page for your project. <a class="headerlink leafygreen-ui-1kepx47" href="#in-the-mongodb-atlas-ui--go-to-the-clusters-page-for-your-project." 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="in-the-mongodb-atlas-ui--go-to-the-clusters-page-for-your-project."> </div> </a> </h3> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If it's not already displayed, select the organization that contains your desired project from the <i class="mms-icon-office mms-icon"> </i> <span class="guilabel css-h15tq0"> Organizations </span> menu <!-- --> in the navigation bar. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If it's not already displayed, select your project from the <span class="guilabel css-h15tq0"> Projects </span> menu in the navigation bar. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If it's not already displayed, click <span class="guilabel css-h15tq0"> Clusters </span> in the sidebar. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://cloud.mongodb.com/go?l=https%3A%2F%2Fcloud.mongodb.com%2Fv2%2F%3Cproject%3E%23%2Fclusters" target="_self"> <span> Clusters </span> </a> page displays. </p> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Navigate to the collection. <a class="headerlink leafygreen-ui-1kepx47" href="#navigate-to-the-collection." 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="navigate-to-the-collection."> </div> </a> </h3> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For the cluster that contains the sample data, click <span class="guilabel css-h15tq0"> Browse Collections </span> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In the left navigation pane, select the <code class="leafygreen-ui-1l06pbn"> sample_mflix </code> database. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Select the <code class="leafygreen-ui-1l06pbn"> movies </code> collection. </p> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify a query filter document. <a class="headerlink leafygreen-ui-1kepx47" href="#specify-a-query-filter-document." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="specify-a-query-filter-document."> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To query a document that contains an array, specify a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document </a> . A query filter document uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/reference/supported-operations/#std-label-csfle-supported-query-operators"> query operators </a> to specify search conditions. Use the following example documents to query array fields in the <code class="leafygreen-ui-1l06pbn"> sample_mflix.movies </code> collection. </p> <p class="leafygreen-ui-1kp3ins"> To apply a query filter, copy an example document into the <span class="guilabel css-h15tq0"> Filter </span> search bar and click <span class="guilabel css-h15tq0"> Apply </span> . </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-32"> <div aria-label="Tabs to describe usage of element/match/multiple" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_igv060q58" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_g8ua2il2i" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Match an Array </div> </button> <button aria-controls="_rf5dgbdxo" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_xswqznjpd" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Query for an Element </div> </button> <button aria-controls="_u6dp40bpk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_4xrudrekm" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Specify Multiple Conditions </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_c0rc4cyed" class="" id="_toj9b3gic" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To specify an equality condition on an array, use the query document <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt;: &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the exact array to match, including the order of the elements. The following example finds documents that have a <code class="leafygreen-ui-1l06pbn"> genres </code> field that contains the <code class="leafygreen-ui-1l06pbn"> ["Action", "Comedy"] </code> array in the specified order: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ genres: [\"Action\", \"Comedy\"] }"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ genres: ["Action", "Comedy"] }</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"> To find an array that contains both the elements <code class="leafygreen-ui-1l06pbn"> Action </code> and <code class="leafygreen-ui-1l06pbn"> Comedy </code> , without regard to order or other elements in the array, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/all/#mongodb-query-op.-all"> <code class="leafygreen-ui-1l06pbn"> $all </code> </a> operator: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ genres: { $all: [\"Action\", \"Comedy\"] } }"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ genres: { $all: ["Action", "Comedy"] } }</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> </div> <div> <div aria-labelledby="_tov1xdkpy" class="leafygreen-ui-38lglc" id="_uf8yl5yvx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To query if the array field contains at least one element with the specified value, use the filter <code class="leafygreen-ui-1l06pbn"> { &lt;field&gt;: &lt;value&gt; } </code> where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is the element value. </p> <p class="leafygreen-ui-1kp3ins"> The following example queries for all documents where the <code class="leafygreen-ui-1l06pbn"> genres </code> field contains the string <code class="leafygreen-ui-1l06pbn"> Short </code> as one of its elements: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ genres: \"Short\" }"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ genres: "Short" }</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"> To specify conditions on the elements in the array field, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query operators </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ &lt;array&gt;: { &lt;operator1&gt;: &lt;value1&gt;, ... } }"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ &lt;array field&gt;: { &lt;operator1&gt;: &lt;value1&gt;, ... } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For example, the following operation uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/nin/#mongodb-query-op.-nin"> <code class="leafygreen-ui-1l06pbn"> $nin </code> </a> operator to query for all documents where the <code class="leafygreen-ui-1l06pbn"> genres </code> field does not contain <code class="leafygreen-ui-1l06pbn"> Drama </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ genres: { $nin: [\"Drama\"] } }"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ genres: { $nin: ["Drama"] } }</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> </div> <div> <div aria-labelledby="_sen431l0i" class="leafygreen-ui-38lglc" id="_nrlse0hll" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> When specifying compound conditions on array elements, you can specify the query such that either a single array element meets these condition or any combination of array elements meets the conditions. </p> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Query an Array with Compound Filter Conditions on the Array Elements <a class="headerlink leafygreen-ui-1kepx47" href="#query-an-array-with-compound-filter-conditions-on-the-array-elements-1" 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="query-an-array-with-compound-filter-conditions-on-the-array-elements-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> The following example queries for documents where the <code class="leafygreen-ui-1l06pbn"> cast </code> array contains elements that in some combination satisfy the query conditions. For example, the following filter uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/regex/#mongodb-query-op.-regex"> <code class="leafygreen-ui-1l06pbn"> $regex </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/eq/#mongodb-query-op.-eq"> <code class="leafygreen-ui-1l06pbn"> $eq </code> </a> operators to return documents where a single array element ends in <code class="leafygreen-ui-1l06pbn"> Olsen </code> and another element equals <code class="leafygreen-ui-1l06pbn"> Mary-Kate Olsen </code> or a single element that satisfies both conditions: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ cast: { $regex: \"Olsen$\", $eq: \"Mary-Kate Olsen\" } }"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ cast: { $regex: "Olsen$", $eq: "Mary-Kate Olsen" } }</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 filter returns movies that include <code class="leafygreen-ui-1l06pbn"> Mary-Kate Olsen </code> in their cast, and movies that include both <code class="leafygreen-ui-1l06pbn"> Mary-Kate Olsen </code> and <code class="leafygreen-ui-1l06pbn"> Ashley Olsen </code> in their cast. </p> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Query for an Array Element that Meets Multiple Criteria <a class="headerlink leafygreen-ui-1kepx47" href="#query-for-an-array-element-that-meets-multiple-criteria-1" 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="query-for-an-array-element-that-meets-multiple-criteria-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/elemMatch/#mongodb-query-op.-elemMatch"> <code class="leafygreen-ui-1l06pbn"> $elemMatch </code> </a> operator to specify multiple criteria on the elements of an array such that at least one array element satisfies all the specified criteria. </p> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/elemMatch/#mongodb-query-op.-elemMatch"> <code class="leafygreen-ui-1l06pbn"> $elemMatch </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/ne/#mongodb-query-op.-ne"> <code class="leafygreen-ui-1l06pbn"> $ne </code> </a> operators to query for documents where the <code class="leafygreen-ui-1l06pbn"> languages </code> array contains at least one element that is both not <code class="leafygreen-ui-1l06pbn"> null </code> and does not equal <code class="leafygreen-ui-1l06pbn"> English </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ languages: { $elemMatch: { $ne: null, $ne: \"English\" } } }"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ languages: { $elemMatch: { $ne: null, $ne: "English" } } }</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> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Query for an Element by the Array Index Position <a class="headerlink leafygreen-ui-1kepx47" href="#query-for-an-element-by-the-array-index-position-1" 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="query-for-an-element-by-the-array-index-position-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-dot-notation"> dot notation </a> , you can specify query conditions for an element at a particular index or position of the array. The array uses zero-based indexing. </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"> When querying using dot notation, the field and nested field must be inside quotation marks. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/ne/#mongodb-query-op.-ne"> <code class="leafygreen-ui-1l06pbn"> $ne </code> </a> operator to query for all documents where the first element in the <code class="leafygreen-ui-1l06pbn"> countries </code> array is not equal to <code class="leafygreen-ui-1l06pbn"> USA </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"countries.0\": { $ne: \"USA\" }"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "countries.0": { $ne: "USA" }</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> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Query an Array by Array Length <a class="headerlink leafygreen-ui-1kepx47" href="#query-an-array-by-array-length-1" 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="query-an-array-by-array-length-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/size/#mongodb-query-op.-size"> <code class="leafygreen-ui-1l06pbn"> $size </code> </a> operator to query for arrays by number of elements. For example, the following selects documents where the array <code class="leafygreen-ui-1l06pbn"> genres </code> has 3 elements. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ genres: { $size: 3 } }"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ genres: { $size: 3 } }</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> </section> </div> </div> </div> </div> </div> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Additional Query Tutorials <a class="headerlink leafygreen-ui-1kepx47" href="#additional-query-tutorials" 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="additional-query-tutorials"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> For additional query examples, see: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/query-documents/"> Query Documents </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/query-embedded-documents/"> Query on Embedded/Nested Documents </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/query-array-of-documents/"> Query an Array of Embedded Documents </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/faq/replica-sets/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> FAQ: Replication and Replica Sets <a class="headerlink leafygreen-ui-1kepx47" href="#faq--replication-and-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="faq--replication-and-replica-sets"> </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="#what-kind-of-replication-does-mongodb-support-" target="_self"> <span> What kind of replication does MongoDB support? </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#does-replication-work-over-the-internet-and-wan-connections-" target="_self"> <span> Does replication work over the Internet and WAN connections? </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#can-mongodb-replicate-over-a--noisy--connection-" target="_self"> <span> Can MongoDB replicate over a "noisy" connection? </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#why-use-journaling-if-replication-already-provides-data-redundancy-" target="_self"> <span> Why use journaling if replication already provides data redundancy? </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#what-information-do-arbiters-exchange-with-the-rest-of-the-replica-set-" target="_self"> <span> What information do arbiters exchange with the rest of the replica set? </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#is-it-normal-for-replica-set-members-to-use-different-amounts-of-disk-space-" target="_self"> <span> Is it normal for replica set members to use different amounts of disk space? </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#can-i-rename-a-replica-set-" target="_self"> <span> Can I rename a replica set? </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> This document answers common questions about replication in MongoDB. See also the <a class="leafygreen-ui-tqgtui" href="/docs/manual/replication/#std-label-replication"> Replication </a> section in the manual, which provides an overview of replication including details on: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-members/#std-label-replica-set-members"> Replica Set Members </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-architectures/#std-label-replica-set-architecture"> Replica Set Deployment Architectures </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-elections/#std-label-replica-set-elections"> Replica Set Elections </a> </p> </li> </ul> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> What kind of replication does MongoDB support? <a class="headerlink leafygreen-ui-1kepx47" href="#what-kind-of-replication-does-mongodb-support-" 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="what-kind-of-replication-does-mongodb-support-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> MongoDB supports <a class="leafygreen-ui-tqgtui" href="/docs/manual/replication/#std-label-replication"> Replica sets </a> , which can have up to 50 nodes. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Does replication work over the Internet and WAN connections? <a class="headerlink leafygreen-ui-1kepx47" href="#does-replication-work-over-the-internet-and-wan-connections-" 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="does-replication-work-over-the-internet-and-wan-connections-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Yes. </p> <p class="leafygreen-ui-1kp3ins"> For example, a deployment may maintain a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondary </a> in an East-coast data center along with a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondary </a> member for disaster recovery in a West-coast data center. </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/tutorial/deploy-geographically-distributed-replica-set/#std-label-server-replica-set-deploy-geo"> Deploy a Geographically Redundant Self-Managed Replica Set </a> </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Can MongoDB replicate over a "noisy" connection? <a class="headerlink leafygreen-ui-1kepx47" href="#can-mongodb-replicate-over-a--noisy--connection-" 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="can-mongodb-replicate-over-a--noisy--connection-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Yes, but not without connection failures and the obvious latency. </p> <p class="leafygreen-ui-1kp3ins"> Members of the set will attempt to reconnect to the other members of the set in response to networking flaps. This does not require administrator intervention. However, if the network connections among the nodes in the replica set are very slow, it might not be possible for the members of the node to keep up with the replication. </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/replica-set-elections/#std-label-replica-set-elections"> Replica Set Elections </a> </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Why use journaling if replication already provides data redundancy? <a class="headerlink leafygreen-ui-1kepx47" href="#why-use-journaling-if-replication-already-provides-data-redundancy-" 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="why-use-journaling-if-replication-already-provides-data-redundancy-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-journal"> Journaling </a> facilitates faster crash recovery. </p> <p class="leafygreen-ui-1kp3ins"> Journaling is particularly useful for protection against power failures, especially if your replica set resides in a single data center or power circuit. </p> <p class="leafygreen-ui-1kp3ins"> When a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> runs with journaling, you can safely restart <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances without additional intervention. </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"> Journaling requires some resource overhead for write operations. Journaling has no effect on read performance, however. </p> <p class="leafygreen-ui-1kp3ins"> Journaling is enabled by default on all 64-bit builds of MongoDB v2.0 and greater. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> What information do arbiters exchange with the rest of the replica set? <a class="headerlink leafygreen-ui-1kepx47" href="#what-information-do-arbiters-exchange-with-the-rest-of-the-replica-set-" 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="what-information-do-arbiters-exchange-with-the-rest-of-the-replica-set-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Arbiters never receive the contents of a collection but do exchange the following data with the rest of the replica set: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Credentials used to authenticate the arbiter with the replica set. These exchanges are encrypted. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Replica set configuration data and voting data. This information is not encrypted. Only credential exchanges are encrypted. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If your MongoDB deployment uses TLS/SSL, then all communications between arbiters and the other members of the replica set are secure. </p> <p class="leafygreen-ui-1kp3ins"> See the documentation for <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/#std-label-configure-mongod-mongos-for-tls-ssl"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> for more information. As with all MongoDB components, run arbiters on secure networks. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-members/#std-label-replica-set-arbiters"> Arbiter Members of Replica Sets </a> </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Is it normal for replica set members to use different amounts of disk space? <a class="headerlink leafygreen-ui-1kepx47" href="#is-it-normal-for-replica-set-members-to-use-different-amounts-of-disk-space-" 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="is-it-normal-for-replica-set-members-to-use-different-amounts-of-disk-space-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Yes. </p> <p class="leafygreen-ui-1kp3ins"> Factors including: different oplog sizes, different levels of storage fragmentation, and MongoDB's data file pre-allocation can lead to some variation in storage utilization between nodes. Storage use disparities will be most pronounced when you add members at different times. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Can I rename a replica set? <a class="headerlink leafygreen-ui-1kepx47" href="#can-i-rename-a-replica-set-" 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="can-i-rename-a-replica-set-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Yes, unsharded replica sets can be renamed. This procedure requires downtime. </p> <p class="leafygreen-ui-1kp3ins"> To learn how to rename your replica set, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/rename-unsharded-replica-set/#std-label-rename-a-replica-set"> Rename a Self-Managed Replica Set <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Before renaming a replica set, perform a full <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/backups/#std-label-backup-methods"> backup of your MongoDB deployment <!-- --> . </a> </p> </section> </section>
https://www.mongodb.com/docs/manual/administration/sharded-cluster-config-servers/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Self-Managed Sharded Cluster Config Server Administration <a class="headerlink leafygreen-ui-1kepx47" href="#self-managed-sharded-cluster-config-server-administration" 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="self-managed-sharded-cluster-config-server-administration"> </div> </a> </h1> <dl> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/replace-config-server/"> Replace a Self-Managed Config Server </a> </dt> <dd class="css-1ufxuu7"> Replace a config server in a config server replica set. </dd> </dl> <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/administration/backup-sharded-clusters/"> Backup and Restore a Self-Managed Sharded Cluster </a> </p> </div> </div> </section>
https://www.mongodb.com/docs/manual/data-modeling/design-patterns/data-versioning/document-versioning/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Keep a History of Document Versions <a class="headerlink leafygreen-ui-1kepx47" href="#keep-a-history-of-document-versions" 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="keep-a-history-of-document-versions"> </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="#about-this-task" target="_self"> <span> About this Task </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#before-you-begin" target="_self"> <span> Before you Begin </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#steps" target="_self"> <span> Steps </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#next-steps" target="_self"> <span> Next Steps </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> <p class="leafygreen-ui-1kp3ins"> When your data changes, some applications require that older versions of your data are kept available. In the <strong> Document Versioning Pattern </strong> , older data versions are retained in a separate collection from the current data. </p> <p class="leafygreen-ui-1kp3ins"> The Document Versioning Pattern lets you keep current documents and their history in the same database, and avoid having to use multiple systems to manage data history. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> About this Task <a class="headerlink leafygreen-ui-1kepx47" href="#about-this-task" 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="about-this-task"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The Document Versioning Pattern works best if your data meets these criteria: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Documents are updated infrequently. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> There are few documents that require version tracking. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Current data and historical data are generally queried separately. In the Document Versioning Pattern, historical data is stored in a separate collection from the current data, so returning both in the same operation can be expensive. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If the preceding criteria do not fit your use case, consider a different solution or change how you implement the Document Versioning Pattern. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Before you Begin <a class="headerlink leafygreen-ui-1kepx47" href="#before-you-begin" 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="before-you-begin"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> In the following example, an insurance company uses the Document Versioning Pattern to track changes to customer policies. Insert the sample document into the <code class="leafygreen-ui-1l06pbn"> currentPolicies </code> and <code class="leafygreen-ui-1l06pbn"> policyRevisions </code> collections: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.currentPolicies.insertOne(\n {\n policyId: 1,\n customerName: \"Michelle\",\n revision: 1,\n itemsInsured: [\n \"golf clubs\",\n \"car\"\n ],\n dateSet: new Date()\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">currentPolicies</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">customerName</span>: <span class="lg-highlight-string">"Michelle"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">revision</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">itemsInsured</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"golf clubs"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"car"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dateSet</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<!-- -->)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.policyRevisions.insertOne(\n {\n policyId: 1,\n customerName: \"Michelle\",\n revision: 1,\n itemsInsured: [\n \"golf clubs\",\n \"car\"\n ],\n dateSet: new Date()\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">policyRevisions</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">customerName</span>: <span class="lg-highlight-string">"Michelle"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">revision</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">itemsInsured</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"golf clubs"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"car"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dateSet</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<!-- -->)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Steps <a class="headerlink leafygreen-ui-1kepx47" href="#steps" 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="steps"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> With the Document Versioning Pattern, when a policy is updated, the following writes occur: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The policy is updated in the <code class="leafygreen-ui-1l06pbn"> currentPolicies </code> collection. The <code class="leafygreen-ui-1l06pbn"> currentPolicies </code> collection only contains the current data revision of each <code class="leafygreen-ui-1l06pbn"> policyId </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The original policy is written to the <code class="leafygreen-ui-1l06pbn"> policyRevisions </code> collection to keep a record of policy changes. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For example, if the user Michelle wants to add a watch to her policy, the application runs these operations: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Updated document:","name":"Update the policy in the currentPolicies collection"},{"@type":"HowToStep","text":"After you run the previous aggregation, the policyRevisions\ncollection contains both the original and updated policies:","name":"Write the updated policy to the policyRevisions collection"}],"name":"Steps","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Update the policy in the currentPolicies collection <a class="headerlink leafygreen-ui-1kepx47" href="#update-the-policy-in-the-currentpolicies-collection" 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="update-the-policy-in-the-currentpolicies-collection"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.currentPolicies.updateOne(\n { policyId: 1 },\n {\n $push: {\n itemsInsured: \"watch\"\n },\n $inc: {\n revision: 1\n },\n $currentDate: {\n dateSet: true\n }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">currentPolicies</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$push</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">itemsInsured</span>: <span class="lg-highlight-string">"watch"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$inc</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">revision</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$currentDate</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dateSet</span>: <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Updated document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: ObjectId(\"661e873d1a930b8ea1f75c57\"),\n policyId: 1,\n customerName: 'Michelle',\n revision: 2,\n itemsInsured: [ 'golf clubs', 'car', 'watch' ],\n dateSet: ISODate(\"2024-04-16T14:12:24.476Z\")\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"661e873d1a930b8ea1f75c57"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">customerName</span>: <span class="lg-highlight-string">'Michelle'</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">revision</span>: <span class="lg-highlight-number">2</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">itemsInsured</span>: <!-- -->[ <span class="lg-highlight-string">'golf clubs'</span>, <span class="lg-highlight-string">'car'</span>, <span class="lg-highlight-string">'watch'</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dateSet</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2024-04-16T14:12:24.476Z"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Write the updated policy to the policyRevisions collection <a class="headerlink leafygreen-ui-1kepx47" href="#write-the-updated-policy-to-the-policyrevisions-collection" 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-the-updated-policy-to-the-policyrevisions-collection"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.currentPolicies.aggregate( [\n {\n $match: { policyId: 1 }\n },\n {\n $set: { _id: new ObjectId() }\n },\n {\n $merge: {\n into: { db: \"test\", coll: \"policyRevisions\" },\n on: \"_id\",\n whenNotMatched: \"insert\"\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">currentPolicies</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$match</span>: <!-- -->{ <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$set</span>: <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<!-- -->) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$merge</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">into</span>: <!-- -->{ <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"test"</span>, <span class="lg-highlight-attr">coll</span>: <span class="lg-highlight-string">"policyRevisions"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">on</span>: <span class="lg-highlight-string">"_id"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">whenNotMatched</span>: <span class="lg-highlight-string">"insert"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> After you run the previous aggregation, the <code class="leafygreen-ui-1l06pbn"> policyRevisions </code> collection contains both the original and updated policies: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n {\n _id: ObjectId(\"6626c8f02a98aba8ddec31d1\"),\n policyId: 1,\n customerName: 'Michelle',\n revision: 1,\n itemsInsured: [ 'golf clubs', 'car' ],\n dateSet: ISODate(\"2024-04-22T20:30:40.809Z\")\n },\n {\n _id: ObjectId(\"6626c92b2a98aba8ddec31d2\"),\n customerName: 'Michelle',\n dateSet: ISODate(\"2024-04-22T20:31:03.000Z\"),\n itemsInsured: [ 'golf clubs', 'car', 'watch' ],\n policyId: 1,\n revision: 2\n }\n]","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"6626c8f02a98aba8ddec31d1"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">customerName</span>: <span class="lg-highlight-string">'Michelle'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">revision</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">itemsInsured</span>: <!-- -->[ <span class="lg-highlight-string">'golf clubs'</span>, <span class="lg-highlight-string">'car'</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dateSet</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2024-04-22T20:30:40.809Z"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"6626c92b2a98aba8ddec31d2"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">customerName</span>: <span class="lg-highlight-string">'Michelle'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dateSet</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2024-04-22T20:31:03.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">itemsInsured</span>: <!-- -->[ <span class="lg-highlight-string">'golf clubs'</span>, <span class="lg-highlight-string">'car'</span>, <span class="lg-highlight-string">'watch'</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">revision</span>: <span class="lg-highlight-number">2</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Next Steps <a class="headerlink leafygreen-ui-1kepx47" href="#next-steps" 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="next-steps"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To view a customer's policy history, you can sort the <code class="leafygreen-ui-1l06pbn"> policyRevisions </code> collection by revision. Consider if the customer Michelle makes another change to her policy and no longer wants to insure her golf clubs. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Updated document:","name":"Update the policy in the currentPolicies collection"},{"@type":"HowToStep","text":"Write the updated policy to the policyRevisions collection"},{"@type":"HowToStep","text":"Output:","name":"Return a history of the policy changes"}],"name":"Next Steps","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Update the policy in the currentPolicies collection <a class="headerlink leafygreen-ui-1kepx47" href="#update-the-policy-in-the-currentpolicies-collection-1" 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="update-the-policy-in-the-currentpolicies-collection-1"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.currentPolicies.updateOne(\n { policyId: 1 },\n {\n $pull: {\n itemsInsured: \"golf clubs\"\n },\n $inc: {\n revision: 1\n },\n $currentDate: {\n dateSet: true\n }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">currentPolicies</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$pull</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">itemsInsured</span>: <span class="lg-highlight-string">"golf clubs"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$inc</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">revision</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$currentDate</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dateSet</span>: <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Updated document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: ObjectId(\"661e873d1a930b8ea1f75c57\"),\n policyId: 1,\n customerName: 'Michelle',\n revision: 3,\n itemsInsured: [ 'car', 'watch' ],\n dateSet: ISODate(\"2024-04-16T14:13:38.203Z\")\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"661e873d1a930b8ea1f75c57"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">customerName</span>: <span class="lg-highlight-string">'Michelle'</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">revision</span>: <span class="lg-highlight-number">3</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">itemsInsured</span>: <!-- -->[ <span class="lg-highlight-string">'car'</span>, <span class="lg-highlight-string">'watch'</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dateSet</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2024-04-16T14:13:38.203Z"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Write the updated policy to the policyRevisions collection <a class="headerlink leafygreen-ui-1kepx47" href="#write-the-updated-policy-to-the-policyrevisions-collection-1" 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-the-updated-policy-to-the-policyrevisions-collection-1"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.currentPolicies.aggregate( [\n {\n $match: { policyId: 1 }\n },\n {\n $set: { _id: new ObjectId() }\n },\n {\n $merge: {\n into: { db: \"test\", coll: \"policyRevisions\" },\n on: \"_id\",\n whenNotMatched: \"insert\"\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">currentPolicies</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$match</span>: <!-- -->{ <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$set</span>: <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<!-- -->) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$merge</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">into</span>: <!-- -->{ <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"test"</span>, <span class="lg-highlight-attr">coll</span>: <span class="lg-highlight-string">"policyRevisions"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">on</span>: <span class="lg-highlight-string">"_id"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">whenNotMatched</span>: <span class="lg-highlight-string">"insert"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Return a history of the policy changes <a class="headerlink leafygreen-ui-1kepx47" href="#return-a-history-of-the-policy-changes" 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="return-a-history-of-the-policy-changes"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.policyRevisions.find( { policyId: 1 } ).sort( { revision: 1 } )","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">policyRevisions</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span> } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">revision</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n {\n _id: ObjectId(\"6626c8f02a98aba8ddec31d1\"),\n policyId: 1,\n customerName: 'Michelle',\n revision: 1,\n itemsInsured: [ 'golf clubs', 'car' ],\n dateSet: ISODate(\"2024-04-22T20:30:40.809Z\")\n },\n {\n _id: ObjectId(\"6626c92b2a98aba8ddec31d2\"),\n customerName: 'Michelle',\n dateSet: ISODate(\"2024-04-22T20:31:03.000Z\"),\n itemsInsured: [ 'golf clubs', 'car', 'watch' ],\n policyId: 1,\n revision: 2\n },\n {\n _id: ObjectId(\"6626c9832a98aba8ddec31d3\"),\n customerName: 'Michelle',\n dateSet: ISODate(\"2024-04-22T20:32:43.232Z\"),\n itemsInsured: [ 'car', 'watch' ],\n policyId: 1,\n revision: 3\n }\n]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"6626c8f02a98aba8ddec31d1"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">customerName</span>: <span class="lg-highlight-string">'Michelle'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">revision</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">itemsInsured</span>: <!-- -->[ <span class="lg-highlight-string">'golf clubs'</span>, <span class="lg-highlight-string">'car'</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dateSet</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2024-04-22T20:30:40.809Z"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"6626c92b2a98aba8ddec31d2"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">customerName</span>: <span class="lg-highlight-string">'Michelle'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dateSet</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2024-04-22T20:31:03.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">itemsInsured</span>: <!-- -->[ <span class="lg-highlight-string">'golf clubs'</span>, <span class="lg-highlight-string">'car'</span>, <span class="lg-highlight-string">'watch'</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">revision</span>: <span class="lg-highlight-number">2</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"6626c9832a98aba8ddec31d3"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">customerName</span>: <span class="lg-highlight-string">'Michelle'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dateSet</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2024-04-22T20:32:43.232Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">itemsInsured</span>: <!-- -->[ <span class="lg-highlight-string">'car'</span>, <span class="lg-highlight-string">'watch'</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">policyId</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">revision</span>: <span class="lg-highlight-number">3</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> </div> </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> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/design-patterns/data-versioning/schema-versioning/#std-label-design-patterns-schema-versioning"> Maintain Different Schema Versions </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/schema-design-process/#std-label-data-modeling-schema-design"> Schema Design Process </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/design-patterns/group-data/#std-label-schema-pattern-group-data"> Group Data </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/update-documents/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Update Documents <a class="headerlink leafygreen-ui-1kepx47" href="#update-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="update-documents"> </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="#update-documents-in-a-collection" target="_self"> <span> Update Documents in a Collection </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#update-a-document-with-mongodb-atlas" target="_self"> <span> Update a Document with MongoDB Atlas </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> You can update documents in MongoDB using the following methods: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your programming language's driver. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/" target="_self"> <span> MongoDB Atlas UI </span> </a> . To learn more, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-update-documents-atlas-ui" target="_self"> <span> Update a Document with MongoDB Atlas <!-- --> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/compass/current/" target="_self"> <span> MongoDB Compass <!-- --> . </span> </a> </p> </li> </ul> <hr class="css-1unva0n e4ru7ww0"/> <p class="leafygreen-ui-1kp3ins"> ➤ <!-- --> Use the <strong> Select your language </strong> drop-down menu in the upper-right to set the language of the following examples. </p> <hr class="css-1unva0n e4ru7ww0"/> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-4"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_nci4ljgcv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lz1b9h1z9" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_7oksdkwgt" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_hti794qd2" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_btdkqmaix" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_c3yolnhv8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_3gan6jswf" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_nugvy6ozh" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_iey212bha" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_q7rusmz8b" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_syz2vtsaw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_mgz70jkvr" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_6xa4voq02" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_wayohin7s" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_y0e04vz8g" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tve62hurw" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_5z8rerynl" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_3k15do0hc" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_qgptp0hfw" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_mq73o0lhd" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_1thifzf9c" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_c2p673tag" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_fcg8i8rgw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_jif91unow" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_11b2tat2r" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ymikwelt0" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_571zoobaf" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0ygno53jw" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_vdty3rk2c" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_7hi9wgc7e" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_z2vjgp8ci" class="leafygreen-ui-38lglc" id="_blvopbowr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <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> methods: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#mongodb-method-db.collection.updateOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.updateOne(&lt;filter&gt;, &lt;update&gt;, &lt;options&gt;) </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateMany/#mongodb-method-db.collection.updateMany"> <code class="leafygreen-ui-1l06pbn"> db.collection.updateMany(&lt;filter&gt;, &lt;update&gt;, &lt;options&gt;) </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.replaceOne/#mongodb-method-db.collection.replaceOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.replaceOne(&lt;filter&gt;, &lt;update&gt;, &lt;options&gt;) </code> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_w9cp8wy7m" class="leafygreen-ui-38lglc" id="_b8hhvoqfo" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/compass/current/#std-label-compass-index" target="_self"> <span> MongoDB Compass </span> </a> to update the documents. </p> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Populate the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection with the following documents: </p> </div> </div> </div> <div> <div aria-labelledby="_6doikiea8" class="leafygreen-ui-38lglc" id="_jtk1c88ot" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongoc.org/libmongoc/current/index.html" rel="noopener noreferrer"> <span> MongoDB C Driver </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> methods: </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://mongoc.org/libmongoc/current/mongoc_collection_update_one.html" rel="noopener noreferrer"> <span> mongoc_collection_update_one </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongoc.org/libmongoc/current/mongoc_collection_replace_one.html" rel="noopener noreferrer"> <span> mongoc_collection_replace_one </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_mhcsq5nlt" class="leafygreen-ui-38lglc" id="_zysi2xgdd" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/csharp/" target="_self"> <span> MongoDB C# Driver </span> </a> methods: </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://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_UpdateOne.htm" rel="noopener noreferrer"> <span> IMongoCollection.UpdateOne() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_UpdateMany.htm" rel="noopener noreferrer"> <span> IMongoCollection.UpdateMany() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_ReplaceOne.htm" rel="noopener noreferrer"> <span> IMongoCollection.ReplaceOne() </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_i53gw13ov" class="leafygreen-ui-38lglc" id="_03t5nqwr5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/go/" target="_self"> <span> MongoDB Go Driver </span> </a> functions: </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://godoc.org/github.com/mongodb/mongo-go-driver/mongo#Collection.UpdateOne" rel="noopener noreferrer"> <span> Collection.UpdateOne </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://godoc.org/github.com/mongodb/mongo-go-driver/mongo#Collection.UpdateMany" rel="noopener noreferrer"> <span> Collection.UpdateMany </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://godoc.org/github.com/mongodb/mongo-go-driver/mongo#Collection.ReplaceOne" rel="noopener noreferrer"> <span> Collection.ReplaceOne </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_mg873z9em" class="leafygreen-ui-38lglc" id="_b1pvw95hi" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver-reactivestreams/1.6/" rel="noopener noreferrer"> <span> Java Reactive Streams Driver </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> methods: </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="http://mongodb.github.io/mongo-java-driver-reactivestreams/1.6/javadoc/com/mongodb/reactivestreams/client/MongoCollection.html#updateOne(org.bson.conversions.Bson,%20org.bson.conversions.Bson)" rel="noopener noreferrer"> <span> com.mongodb.reactivestreams.client.MongoCollection.updateOne </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver-reactivestreams/1.6/javadoc/com/mongodb/reactivestreams/client/MongoCollection.html#updateMany(org.bson.conversions.Bson,%20org.bson.conversions.Bson)" rel="noopener noreferrer"> <span> com.mongodb.reactivestreams.client.MongoCollection.updateMany </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver-reactivestreams/1.6/javadoc/com/mongodb/reactivestreams/client/MongoCollection.html#replaceOne(org.bson.conversions.Bson,%20TDocument)" rel="noopener noreferrer"> <span> com.mongodb.reactivestreams.client.MongoCollection.replaceOne </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_m235uc4he" class="leafygreen-ui-38lglc" id="_6fj4wx073" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver/3.4/driver/" rel="noopener noreferrer"> <span> Java Synchronous Driver </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> methods: </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://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/MongoCollection.html#updateOne-org.bson.conversions.Bson-org.bson.conversions.Bson-" rel="noopener noreferrer"> <span> com.mongodb.client.MongoCollection.updateOne </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/MongoCollection.html#updateMany-org.bson.conversions.Bson-org.bson.conversions.Bson-" rel="noopener noreferrer"> <span> com.mongodb.client.MongoCollection.updateMany </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/MongoCollection.html#replaceOne-org.bson.conversions.Bson-TDocument-" rel="noopener noreferrer"> <span> com.mongodb.client.MongoCollection.replaceOne </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_92jhrnfoa" class="leafygreen-ui-38lglc" id="_qieg1t2ue" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/kotlin/coroutine/current/" target="_self"> <span> Kotlin Coroutine Driver </span> </a> methods: </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://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-one.html" rel="noopener noreferrer"> <span> MongoCollection.updateOne() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-many.html" rel="noopener noreferrer"> <span> MongoCollection.updateMany() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/replace-one.html" rel="noopener noreferrer"> <span> MongoCollection.replaceOne() </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_kmd1e62y2" class="leafygreen-ui-38lglc" id="_r7pvy2e9q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://motor.readthedocs.io/en/stable/" rel="noopener noreferrer"> <span> Motor </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> driver methods: </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://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_collection.html#motor.motor_asyncio.AsyncIOMotorCollection.update_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> motor.motor_asyncio.AsyncIOMotorCollection.update_one </code> </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_collection.html#motor.motor_asyncio.AsyncIOMotorCollection.update_many" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> motor.motor_asyncio.AsyncIOMotorCollection.update_many </code> </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_collection.html#motor.motor_asyncio.AsyncIOMotorCollection.replace_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> motor.motor_asyncio.AsyncIOMotorCollection.replace_one </code> </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_kancntoqm" class="" id="_gynnmaj3y" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/node-mongodb-native/3.6/" rel="noopener noreferrer"> <span> MongoDB Node.js Driver </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> methods: </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="http://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#updateOne" rel="noopener noreferrer"> <span> Collection.updateOne() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#updateMany" rel="noopener noreferrer"> <span> Collection.updateMany() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#replaceOne" rel="noopener noreferrer"> <span> Collection.replaceOne() </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_mta7f32fm" class="leafygreen-ui-38lglc" id="_pdrnhoph4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://metacpan.org/release/MongoDB" rel="noopener noreferrer"> <span> MongoDB Perl Driver </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> methods: </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://metacpan.org/pod/MongoDB::Collection#update_one" rel="noopener noreferrer"> <span> MongoDB::Collection::update_one() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://metacpan.org/pod/MongoDB::Collection#update_many" rel="noopener noreferrer"> <span> MongoDB::Collection::update_many() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://metacpan.org/pod/MongoDB::Collection#replace_one" rel="noopener noreferrer"> <span> MongoDB::Collection::replace_one() </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_zvh0jjdyq" class="leafygreen-ui-38lglc" id="_uza0uhy4v" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/php-library/current/" target="_self"> <span> MongoDB PHP Library </span> </a> methods: </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/php-library/upcoming/reference/method/MongoDBCollection-updateOne/#mongodb-phpmethod-phpmethod.MongoDB-Collection--updateOne--" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> MongoDB\\Collection::updateOne() </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/php-library/upcoming/reference/method/MongoDBCollection-updateMany/#mongodb-phpmethod-phpmethod.MongoDB-Collection--updateMany--" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> MongoDB\\Collection::updateMany() </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/php-library/upcoming/reference/method/MongoDBCollection-replaceOne/#mongodb-phpmethod-phpmethod.MongoDB-Collection--replaceOne--" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> MongoDB\\Collection::replaceOne() </code> </span> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_otoewexp6" class="leafygreen-ui-38lglc" id="_24amah8ln" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://pymongo.readthedocs.io/en/stable/index.html" rel="noopener noreferrer"> <span> PyMongo </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> Python driver methods: </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://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.update_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> pymongo.collection.Collection.update_one </code> </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.update_many" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> pymongo.collection.Collection.update_many </code> </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.replace_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> pymongo.collection.Collection.replace_one </code> </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_94v54fzhi" class="leafygreen-ui-38lglc" id="_sxq7y4rtp" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/ruby-driver/current/" target="_self"> <span> MongoDB Ruby Driver </span> </a> methods: </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="http://api.mongodb.com/ruby/current/Mongo/Collection.html#update_one-instance_method" target="_self"> <span> Mongo::Collection#update_one() </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://api.mongodb.com/ruby/current/Mongo/Collection.html#update_many-instance_method" target="_self"> <span> Mongo::Collection#update_many() </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://api.mongodb.com/ruby/current/Mongo/Collection.html#replace_one-instance_method" target="_self"> <span> Mongo::Collection#replace_one() </span> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> <div> <div aria-labelledby="_x5488h4wa" class="leafygreen-ui-38lglc" id="_s6fctoiql" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> This page uses the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-scala-driver/" rel="noopener noreferrer"> <span> MongoDB Scala Driver </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> methods: </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="http://mongodb.github.io/mongo-scala-driver/2.9/scaladoc/org/mongodb/scala/MongoCollection.html#updateOne(filter:org.mongodb.scala.bson.conversions.Bson,update:org.mongodb.scala.bson.conversions.Bson,options:org.mongodb.scala.model.UpdateOptions):org.mongodb.scala.SingleObservable[org.mongodb.scala.result.UpdateResult]" rel="noopener noreferrer"> <span> collection.updateOne() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-scala-driver/2.9/scaladoc/org/mongodb/scala/MongoCollection.html#updateMany(filter:org.mongodb.scala.bson.conversions.Bson,update:org.mongodb.scala.bson.conversions.Bson,options:org.mongodb.scala.model.UpdateOptions):org.mongodb.scala.SingleObservable[org.mongodb.scala.result.UpdateResult]" rel="noopener noreferrer"> <span> collection.updateMany() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-scala-driver/2.9/scaladoc/org/mongodb/scala/MongoCollection.html#replaceOne(filter:org.mongodb.scala.bson.conversions.Bson,replacement:TResult,options:org.mongodb.scala.model.UpdateOptions):org.mongodb.scala.SingleObservable[org.mongodb.scala.result.UpdateResult]" rel="noopener noreferrer"> <span> collection.replaceOne() </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> <p class="leafygreen-ui-1kp3ins"> The examples on this page use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Connect to a test database in your MongoDB instance then create the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> </div> </div> </div> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-5"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_azum9bvmg" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_wv496jqpn" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_857sytx13" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_cp7y891h8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_75eo43fk3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_i9x4qmz4p" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_f5vpekxvr" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_kmna7dmsm" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_0dcpl8wk9" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9ggiiquxk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_hsx0v6148" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_cnzqg2v0j" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_qfqbbtemu" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_wgw87gez5" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_iy3r3qzhq" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_1rr7xjtwr" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_xbjhd7x9g" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_t5ehkj9v9" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_ub3oudja5" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_w9r2zviuy" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_yyr9bb2pw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_swavf3xtg" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_g186f72zp" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lzcjh6j0p" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_pi6w72sht" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_i1sfkvhbp" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_eu4k31own" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5w8k2qhve" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_046n36oo3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_3sw4fsyzi" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_wyvep5vj7" class="leafygreen-ui-38lglc" id="_nu78s0x11" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.insertMany( [\n { item: \"canvas\", qty: 100, size: { h: 28, w: 35.5, uom: \"cm\" }, status: \"A\" },\n { item: \"journal\", qty: 25, size: { h: 14, w: 21, uom: \"cm\" }, status: \"A\" },\n { item: \"mat\", qty: 85, size: { h: 27.9, w: 35.5, uom: \"cm\" }, status: \"A\" },\n { item: \"mousepad\", qty: 25, size: { h: 19, w: 22.85, uom: \"cm\" }, status: \"P\" },\n { item: \"notebook\", qty: 50, size: { h: 8.5, w: 11, uom: \"in\" }, status: \"P\" },\n { item: \"paper\", qty: 100, size: { h: 8.5, w: 11, uom: \"in\" }, status: \"D\" },\n { item: \"planner\", qty: 75, size: { h: 22.85, w: 30, uom: \"cm\" }, status: \"D\" },\n { item: \"postcard\", qty: 45, size: { h: 10, w: 15.25, uom: \"cm\" }, status: \"A\" },\n { item: \"sketchbook\", qty: 80, size: { h: 14, w: 21, uom: \"cm\" }, status: \"A\" },\n { item: \"sketch pad\", qty: 95, size: { h: 22.85, w: 30.5, uom: \"cm\" }, status: \"A\" }\n] );","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"canvas"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">100</span>, <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">28</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"A"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"journal"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">25</span>, <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">21</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"A"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"mat"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">85</span>, <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">27.9</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"A"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"mousepad"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">25</span>, <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">19</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"P"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"notebook"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">50</span>, <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">"in"</span> }<!-- -->, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"P"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"paper"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">100</span>, <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">"in"</span> }<!-- -->, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"D"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"planner"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">75</span>, <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">30</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"D"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"postcard"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">45</span>, <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">15.25</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"A"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"sketchbook"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">80</span>, <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">21</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"A"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"sketch pad"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">95</span>, <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">30.5</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"A"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-31-menu" aria-describedby="select-31-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-32" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r8s:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r8s:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r8s:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r8s:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_bw6cjxx0e" class="leafygreen-ui-38lglc" id="_jn2fl2oq8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n { \"item\": \"canvas\", \"qty\": 100, \"size\": { \"h\": 28, \"w\": 35.5, \"uom\": \"cm\" }, \"status\": \"A\" },\n { \"item\": \"journal\", \"qty\": 25, \"size\": { \"h\": 14, \"w\": 21, \"uom\": \"cm\" }, \"status\": \"A\" },\n { \"item\": \"mat\", \"qty\": 85, \"size\": { \"h\": 27.9, \"w\": 35.5, \"uom\": \"cm\" }, \"status\": \"A\" },\n { \"item\": \"mousepad\", \"qty\": 25, \"size\": { \"h\": 19, \"w\": 22.85, \"uom\": \"cm\" }, \"status\": \"P\" },\n { \"item\": \"notebook\", \"qty\": 50, \"size\": { \"h\": 8.5, \"w\": 11, \"uom\": \"in\" }, \"status\": \"P\" },\n { \"item\": \"paper\", \"qty\": 100, \"size\": { \"h\": 8.5, \"w\": 11, \"uom\": \"in\" }, \"status\": \"D\" },\n { \"item\": \"planner\", \"qty\": 75, \"size\": { \"h\": 22.85, \"w\": 30, \"uom\": \"cm\" }, \"status\": \"D\" },\n { \"item\": \"postcard\", \"qty\": 45, \"size\": { \"h\": 10, \"w\": 15.25, \"uom\": \"cm\" }, \"status\": \"A\" },\n { \"item\": \"sketchbook\", \"qty\": 80, \"size\": { \"h\": 14, \"w\": 21, \"uom\": \"cm\" }, \"status\": \"A\" },\n { \"item\": \"sketch pad\", \"qty\": 95, \"size\": { \"h\": 22.85, \"w\": 30.5, \"uom\": \"cm\" }, \"status\": \"A\" }\n]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"canvas"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">100</span>, <span class="lg-highlight-string">"size"</span>: <!-- -->{ <span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">28</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"journal"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">25</span>, <span class="lg-highlight-string">"size"</span>: <!-- -->{ <span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">21</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"mat"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">85</span>, <span class="lg-highlight-string">"size"</span>: <!-- -->{ <span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">27.9</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"mousepad"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">25</span>, <span class="lg-highlight-string">"size"</span>: <!-- -->{ <span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">19</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"P"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"notebook"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">50</span>, <span class="lg-highlight-string">"size"</span>: <!-- -->{ <span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"in"</span> }<!-- -->, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"P"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"paper"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">100</span>, <span class="lg-highlight-string">"size"</span>: <!-- -->{ <span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"in"</span> }<!-- -->, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"D"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"planner"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">75</span>, <span class="lg-highlight-string">"size"</span>: <!-- -->{ <span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">30</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"D"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"postcard"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">45</span>, <span class="lg-highlight-string">"size"</span>: <!-- -->{ <span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">15.25</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"sketchbook"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">80</span>, <span class="lg-highlight-string">"size"</span>: <!-- -->{ <span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">21</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"sketch pad"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">95</span>, <span class="lg-highlight-string">"size"</span>: <!-- -->{ <span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">30.5</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span> }<!-- -->, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-34-menu" aria-describedby="select-34-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-35" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r8t:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r8t:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r8t:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r8t:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For instructions on inserting documents using <!-- --> MongoDB Compass <!-- --> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/insert-documents/#std-label-write-op-insert"> Insert Documents <!-- --> . </a> </p> </div> </div> </div> <div> <div aria-labelledby="_rrjc5caok" class="leafygreen-ui-38lglc" id="_wqwmzzt5o" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongoc_collection_t *collection;\nmongoc_bulk_operation_t *bulk;\nbson_t *doc;\nbool r;\nbson_error_t error;\nbson_t reply;\n\ncollection = mongoc_database_get_collection (db, \"inventory\");\nbulk = mongoc_collection_create_bulk_operation_with_opts (collection, NULL);\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"canvas\"),\n \"qty\", BCON_INT64 (100),\n \"size\", \"{\",\n \"h\", BCON_DOUBLE (28),\n \"w\", BCON_DOUBLE (35.5),\n \"uom\", BCON_UTF8 (\"cm\"),\n \"}\",\n \"status\", BCON_UTF8 (\"A\"));\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"journal\"),\n \"qty\", BCON_INT64 (25),\n \"size\", \"{\",\n \"h\", BCON_DOUBLE (14),\n \"w\", BCON_DOUBLE (21),\n \"uom\", BCON_UTF8 (\"cm\"),\n \"}\",\n \"status\", BCON_UTF8 (\"A\"));\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"mat\"),\n \"qty\", BCON_INT64 (85),\n \"size\", \"{\",\n \"h\", BCON_DOUBLE (27.9),\n \"w\", BCON_DOUBLE (35.5),\n \"uom\", BCON_UTF8 (\"cm\"),\n \"}\",\n \"status\", BCON_UTF8 (\"A\"));\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"mousepad\"),\n \"qty\", BCON_INT64 (25),\n \"size\", \"{\",\n \"h\", BCON_DOUBLE (19),\n \"w\", BCON_DOUBLE (22.85),\n \"uom\", BCON_UTF8 (\"cm\"),\n \"}\",\n \"status\", BCON_UTF8 (\"P\"));\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"notebook\"),\n \"qty\", BCON_INT64 (50),\n \"size\", \"{\",\n \"h\", BCON_DOUBLE (8.5),\n \"w\", BCON_DOUBLE (11),\n \"uom\", BCON_UTF8 (\"in\"),\n \"}\",\n \"status\", BCON_UTF8 (\"P\"));\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"paper\"),\n \"qty\", BCON_INT64 (100),\n \"size\", \"{\",\n \"h\", BCON_DOUBLE (8.5),\n \"w\", BCON_DOUBLE (11),\n \"uom\", BCON_UTF8 (\"in\"),\n \"}\",\n \"status\", BCON_UTF8 (\"D\"));\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"planner\"),\n \"qty\", BCON_INT64 (75),\n \"size\", \"{\",\n \"h\", BCON_DOUBLE (22.85),\n \"w\", BCON_DOUBLE (30),\n \"uom\", BCON_UTF8 (\"cm\"),\n \"}\",\n \"status\", BCON_UTF8 (\"D\"));\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"postcard\"),\n \"qty\", BCON_INT64 (45),\n \"size\", \"{\",\n \"h\", BCON_DOUBLE (10),\n \"w\", BCON_DOUBLE (15.25),\n \"uom\", BCON_UTF8 (\"cm\"),\n \"}\",\n \"status\", BCON_UTF8 (\"A\"));\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"sketchbook\"),\n \"qty\", BCON_INT64 (80),\n \"size\", \"{\",\n \"h\", BCON_DOUBLE (14),\n \"w\", BCON_DOUBLE (21),\n \"uom\", BCON_UTF8 (\"cm\"),\n \"}\",\n \"status\", BCON_UTF8 (\"A\"));\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\ndoc = BCON_NEW (\n \"item\", BCON_UTF8 (\"sketch pad\"),\n \"qty\", BCON_INT64 (95),\n \"size\", \"{\",\n \"h\", BCON_DOUBLE (22.85),\n \"w\", BCON_DOUBLE (30.5),\n \"uom\", BCON_UTF8 (\"cm\"),\n \"}\",\n \"status\", BCON_UTF8 (\"A\"));\n\nr = mongoc_bulk_operation_insert_with_opts (bulk, doc, NULL, &amp;error);\nbson_destroy (doc);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}\n\n/* \"reply\" is initialized on success or error */\nr = (bool) mongoc_bulk_operation_execute (bulk, &amp;reply, &amp;error);\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n}","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongoc_collection_t *collection;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongoc_bulk_operation_t *bulk;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *doc;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bool r;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_error_t error;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t reply;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection <!-- -->= <!-- -->mongoc_database_get_collection (db<!-- -->, <span class="lg-highlight-string">"inventory"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bulk <!-- -->= <!-- -->mongoc_collection_create_bulk_operation_with_opts (collection<!-- -->, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"canvas"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">100</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"h"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">28</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"w"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">35.5</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"uom"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"cm"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"A"</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"journal"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">25</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"h"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">14</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"w"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">21</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"uom"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"cm"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"A"</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"mat"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">85</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"h"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">27.9</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"w"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">35.5</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"uom"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"cm"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"A"</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"mousepad"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">25</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"h"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">19</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"w"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">22.85</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"uom"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"cm"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"P"</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"notebook"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">50</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"h"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">8.5</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"w"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">11</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"uom"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"in"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"P"</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"paper"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">100</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"h"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">8.5</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"w"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">11</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"uom"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"in"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"D"</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"planner"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">75</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"h"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">22.85</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"w"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">30</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"uom"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"cm"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"D"</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"postcard"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">45</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"h"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">10</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"w"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">15.25</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"uom"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"cm"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"A"</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"sketchbook"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">80</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"h"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">14</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"w"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">21</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"uom"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"cm"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"A"</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"sketch pad"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">95</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"h"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">22.85</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"w"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_DOUBLE</span> (<!-- --><span class="lg-highlight-number">30.5</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"uom"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"cm"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><!-- --><span class="lg-highlight-string">"A"</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->mongoc_bulk_operation_insert_with_opts (bulk<!-- -->, doc, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->doc);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">/* "reply"</span><span class="lg-highlight-comment"> is initialized on </span><span class="lg-highlight-comment">success or error */</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- -->(bool) mongoc_bulk_operation_execute (<!-- -->bulk<!-- -->, <!-- -->&amp;reply, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-37-menu" aria-describedby="select-37-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-38" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r8u:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r8u:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r8u:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r8u:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_zfi3bk8ud" class="leafygreen-ui-38lglc" id="_ojrarx0sm" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var documents = new[]\n{\n new BsonDocument\n {\n { \"item\", \"canvas\" },\n { \"qty\", 100 },\n { \"size\", new BsonDocument { { \"h\", 28 }, { \"w\", 35.5 }, { \"uom\", \"cm\" } } },\n { \"status\", \"A\" }\n },\n new BsonDocument\n {\n { \"item\", \"journal\" },\n { \"qty\", 25 },\n { \"size\", new BsonDocument { { \"h\", 14 }, { \"w\", 21 }, { \"uom\", \"cm\" } } },\n { \"status\", \"A\" }\n },\n new BsonDocument\n {\n { \"item\", \"mat\" },\n { \"qty\", 85 },\n { \"size\", new BsonDocument { { \"h\", 27.9 }, { \"w\", 35.5 }, { \"uom\", \"cm\" } } },\n { \"status\", \"A\" }\n },\n new BsonDocument\n {\n { \"item\", \"mousepad\" },\n { \"qty\", 25 },\n { \"size\", new BsonDocument { { \"h\", 19 }, { \"w\", 22.85 }, { \"uom\", \"cm\" } } },\n { \"status\", \"P\" }\n },\n new BsonDocument\n {\n { \"item\", \"notebook\" },\n { \"qty\", 50 },\n { \"size\", new BsonDocument { { \"h\", 8.5 }, { \"w\", 11 }, { \"uom\", \"in\" } } },\n { \"status\", \"P\" } },\n new BsonDocument\n {\n { \"item\", \"paper\" },\n { \"qty\", 100 },\n { \"size\", new BsonDocument { { \"h\", 8.5 }, { \"w\", 11 }, { \"uom\", \"in\" } } },\n { \"status\", \"D\" }\n },\n new BsonDocument\n {\n { \"item\", \"planner\" },\n { \"qty\", 75 },\n { \"size\", new BsonDocument { { \"h\", 22.85 }, { \"w\", 30 }, { \"uom\", \"cm\" } } },\n { \"status\", \"D\" }\n },\n new BsonDocument\n {\n { \"item\", \"postcard\" },\n { \"qty\", 45 },\n { \"size\", new BsonDocument { { \"h\", 10 }, { \"w\", 15.25 }, { \"uom\", \"cm\" } } },\n { \"status\", \"A\" }\n },\n new BsonDocument\n {\n { \"item\", \"sketchbook\" },\n { \"qty\", 80 },\n { \"size\", new BsonDocument { { \"h\", 14 }, { \"w\", 21 }, { \"uom\", \"cm\" } } },\n { \"status\", \"A\" }\n },\n new BsonDocument\n {\n { \"item\", \"sketch pad\" },\n { \"qty\", 95 },\n { \"size\", new BsonDocument { { \"h\", 22.85 }, { \"w\", 30.5 }, { \"uom\", \"cm\" } } }, { \"status\", \"A\" } },\n};\ncollection.InsertMany(documents);","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> documents = <span class="lg-highlight-keyword">new</span>[]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"canvas"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">100</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span> { { <span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">28</span> }, { <span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">35.5</span> }, { <span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span> } } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"journal"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">25</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span> { { <span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">14</span> }, { <span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">21</span> }, { <span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span> } } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"mat"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">85</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span> { { <span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">27.9</span> }, { <span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">35.5</span> }, { <span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span> } } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"mousepad"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">25</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span> { { <span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">19</span> }, { <span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">22.85</span> }, { <span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span> } } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"notebook"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">50</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span> { { <span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">8.5</span> }, { <span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">11</span> }, { <span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"in"</span> } } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span> } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">100</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span> { { <span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">8.5</span> }, { <span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">11</span> }, { <span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"in"</span> } } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"D"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"planner"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">75</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span> { { <span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">22.85</span> }, { <span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">30</span> }, { <span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span> } } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"D"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"postcard"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">45</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span> { { <span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">10</span> }, { <span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">15.25</span> }, { <span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span> } } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"sketchbook"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">80</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span> { { <span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">14</span> }, { <span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">21</span> }, { <span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span> } } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"sketch pad"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">95</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span> { { <span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">22.85</span> }, { <span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">30.5</span> }, { <span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span> } } }, { <span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span> } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">};</td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-class">InsertMany</span>(documents);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-40-menu" aria-describedby="select-40-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-41" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r8v:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r8v:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r8v:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r8v:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_hai3l05j1" class="leafygreen-ui-38lglc" id="_bdnnmi65t" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\ndocs := []interface{}{\n\tbson.D{\n\t\t{\"item\", \"canvas\"},\n\t\t{\"qty\", 100},\n\t\t{\"size\", bson.D{\n\t\t\t{\"h\", 28},\n\t\t\t{\"w\", 35.5},\n\t\t\t{\"uom\", \"cm\"},\n\t\t}},\n\t\t{\"status\", \"A\"},\n\t},\n\tbson.D{\n\t\t{\"item\", \"journal\"},\n\t\t{\"qty\", 25},\n\t\t{\"size\", bson.D{\n\t\t\t{\"h\", 14},\n\t\t\t{\"w\", 21},\n\t\t\t{\"uom\", \"cm\"},\n\t\t}},\n\t\t{\"status\", \"A\"},\n\t},\n\tbson.D{\n\t\t{\"item\", \"mat\"},\n\t\t{\"qty\", 85},\n\t\t{\"size\", bson.D{\n\t\t\t{\"h\", 27.9},\n\t\t\t{\"w\", 35.5},\n\t\t\t{\"uom\", \"cm\"},\n\t\t}},\n\t\t{\"status\", \"A\"},\n\t},\n\tbson.D{\n\t\t{\"item\", \"mousepad\"},\n\t\t{\"qty\", 25},\n\t\t{\"size\", bson.D{\n\t\t\t{\"h\", 19},\n\t\t\t{\"w\", 22.85},\n\t\t\t{\"uom\", \"in\"},\n\t\t}},\n\t\t{\"status\", \"P\"},\n\t},\n\tbson.D{\n\t\t{\"item\", \"notebook\"},\n\t\t{\"qty\", 50},\n\t\t{\"size\", bson.D{\n\t\t\t{\"h\", 8.5},\n\t\t\t{\"w\", 11},\n\t\t\t{\"uom\", \"in\"},\n\t\t}},\n\t\t{\"status\", \"P\"},\n\t},\n\tbson.D{\n\t\t{\"item\", \"paper\"},\n\t\t{\"qty\", 100},\n\t\t{\"size\", bson.D{\n\t\t\t{\"h\", 8.5},\n\t\t\t{\"w\", 11},\n\t\t\t{\"uom\", \"in\"},\n\t\t}},\n\t\t{\"status\", \"D\"},\n\t},\n\tbson.D{\n\t\t{\"item\", \"planner\"},\n\t\t{\"qty\", 75},\n\t\t{\"size\", bson.D{\n\t\t\t{\"h\", 22.85},\n\t\t\t{\"w\", 30},\n\t\t\t{\"uom\", \"cm\"},\n\t\t}},\n\t\t{\"status\", \"D\"},\n\t},\n\tbson.D{\n\t\t{\"item\", \"postcard\"},\n\t\t{\"qty\", 45},\n\t\t{\"size\", bson.D{\n\t\t\t{\"h\", 10},\n\t\t\t{\"w\", 15.25},\n\t\t\t{\"uom\", \"cm\"},\n\t\t}},\n\t\t{\"status\", \"A\"},\n\t},\n\tbson.D{\n\t\t{\"item\", \"sketchbook\"},\n\t\t{\"qty\", 80},\n\t\t{\"size\", bson.D{\n\t\t\t{\"h\", 14},\n\t\t\t{\"w\", 21},\n\t\t\t{\"uom\", \"cm\"},\n\t\t}},\n\t\t{\"status\", \"A\"},\n\t},\n\tbson.D{\n\t\t{\"item\", \"sketch pad\"},\n\t\t{\"qty\", 95},\n\t\t{\"size\", bson.D{\n\t\t\t{\"h\", 22.85},\n\t\t\t{\"w\", 30.5},\n\t\t\t{\"uom\", \"cm\"},\n\t\t}},\n\t\t{\"status\", \"A\"},\n\t},\n}\n\nresult, err := coll.InsertMany(context.TODO(), docs)\n","programmingLanguage":"Golang"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">docs <!-- -->:<!-- -->= []interface{}{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"canvas"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">100</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"size"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">28</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">35.5</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"journal"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">25</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"size"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">14</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">21</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"mat"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">85</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"size"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">27.9</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">35.5</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"mousepad"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">25</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"size"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">19</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">22.85</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"in"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"notebook"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">50</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"size"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">8.5</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">11</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"in"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">100</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"size"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">8.5</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">11</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"in"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"D"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"planner"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">75</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"size"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">22.85</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">30</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"D"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"postcard"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">45</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"size"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">10</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">15.25</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"sketchbook"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">80</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"size"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">14</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">21</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"sketch pad"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">95</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"size"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">22.85</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">30.5</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">result<!-- -->, <!-- -->err := coll.<span class="lg-highlight-title lg-highlight-class">InsertMany</span>(context.<span class="lg-highlight-title lg-highlight-function">TODO</span>(), docs)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-43-menu" aria-describedby="select-43-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-44" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r90:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r90:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r90:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r90:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_il9ga8a4x" class="leafygreen-ui-38lglc" id="_6kztzhol4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"Publisher&lt;success&gt; insertManyPublisher = collection.insertMany(asList(\n Document.parse(\"{ item: 'canvas', qty: 100, size: { h: 28, w: 35.5, uom: 'cm' }, status: 'A' }\"),\n Document.parse(\"{ item: 'journal', qty: 25, size: { h: 14, w: 21, uom: 'cm' }, status: 'A' }\"),\n Document.parse(\"{ item: 'mat', qty: 85, size: { h: 27.9, w: 35.5, uom: 'cm' }, status: 'A' }\"),\n Document.parse(\"{ item: 'mousepad', qty: 25, size: { h: 19, w: 22.85, uom: 'cm' }, status: 'P' }\"),\n Document.parse(\"{ item: 'notebook', qty: 50, size: { h: 8.5, w: 11, uom: 'in' }, status: 'P' }\"),\n Document.parse(\"{ item: 'paper', qty: 100, size: { h: 8.5, w: 11, uom: 'in' }, status: 'D' }\"),\n Document.parse(\"{ item: 'planner', qty: 75, size: { h: 22.85, w: 30, uom: 'cm' }, status: 'D' }\"),\n Document.parse(\"{ item: 'postcard', qty: 45, size: { h: 10, w: 15.25, uom: 'cm' }, status: 'A' }\"),\n Document.parse(\"{ item: 'sketchbook', qty: 80, size: { h: 14, w: 21, uom: 'cm' }, status: 'A' }\"),\n Document.parse(\"{ item: 'sketch pad', qty: 95, size: { h: 22.85, w: 30.5, uom: 'cm' }, status: 'A' }\")\n));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">Publisher</span>&lt;<span class="lg-highlight-title lg-highlight-class">Success</span>&gt; insertManyPublisher = collection.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<span class="lg-highlight-title lg-highlight-function">asList</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'canvas', qty: 100, size: { h: 28, w: 35.5, uom: 'cm' }, status: 'A' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'journal', qty: 25, size: { h: 14, w: 21, uom: 'cm' }, status: 'A' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'mat', qty: 85, size: { h: 27.9, w: 35.5, uom: 'cm' }, status: 'A' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'mousepad', qty: 25, size: { h: 19, w: 22.85, uom: 'cm' }, status: 'P' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'notebook', qty: 50, size: { h: 8.5, w: 11, uom: 'in' }, status: 'P' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'paper', qty: 100, size: { h: 8.5, w: 11, uom: 'in' }, status: 'D' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'planner', qty: 75, size: { h: 22.85, w: 30, uom: 'cm' }, status: 'D' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'postcard', qty: 45, size: { h: 10, w: 15.25, uom: 'cm' }, status: 'A' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'sketchbook', qty: 80, size: { h: 14, w: 21, uom: 'cm' }, status: 'A' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'sketch pad', qty: 95, size: { h: 22.85, w: 30.5, uom: 'cm' }, status: 'A' }"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-46-menu" aria-describedby="select-46-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-47" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r91:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r91:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r91:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r91:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_zsvz7dio9" class="leafygreen-ui-38lglc" id="_shzyh0lcg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.insertMany(asList(\n Document.parse(\"{ item: 'canvas', qty: 100, size: { h: 28, w: 35.5, uom: 'cm' }, status: 'A' }\"),\n Document.parse(\"{ item: 'journal', qty: 25, size: { h: 14, w: 21, uom: 'cm' }, status: 'A' }\"),\n Document.parse(\"{ item: 'mat', qty: 85, size: { h: 27.9, w: 35.5, uom: 'cm' }, status: 'A' }\"),\n Document.parse(\"{ item: 'mousepad', qty: 25, size: { h: 19, w: 22.85, uom: 'cm' }, status: 'P' }\"),\n Document.parse(\"{ item: 'notebook', qty: 50, size: { h: 8.5, w: 11, uom: 'in' }, status: 'P' }\"),\n Document.parse(\"{ item: 'paper', qty: 100, size: { h: 8.5, w: 11, uom: 'in' }, status: 'D' }\"),\n Document.parse(\"{ item: 'planner', qty: 75, size: { h: 22.85, w: 30, uom: 'cm' }, status: 'D' }\"),\n Document.parse(\"{ item: 'postcard', qty: 45, size: { h: 10, w: 15.25, uom: 'cm' }, status: 'A' }\"),\n Document.parse(\"{ item: 'sketchbook', qty: 80, size: { h: 14, w: 21, uom: 'cm' }, status: 'A' }\"),\n Document.parse(\"{ item: 'sketch pad', qty: 95, size: { h: 22.85, w: 30.5, uom: 'cm' }, status: 'A' }\")\n));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<span class="lg-highlight-title lg-highlight-function">asList</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'canvas', qty: 100, size: { h: 28, w: 35.5, uom: 'cm' }, status: 'A' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'journal', qty: 25, size: { h: 14, w: 21, uom: 'cm' }, status: 'A' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'mat', qty: 85, size: { h: 27.9, w: 35.5, uom: 'cm' }, status: 'A' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'mousepad', qty: 25, size: { h: 19, w: 22.85, uom: 'cm' }, status: 'P' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'notebook', qty: 50, size: { h: 8.5, w: 11, uom: 'in' }, status: 'P' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'paper', qty: 100, size: { h: 8.5, w: 11, uom: 'in' }, status: 'D' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'planner', qty: 75, size: { h: 22.85, w: 30, uom: 'cm' }, status: 'D' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'postcard', qty: 45, size: { h: 10, w: 15.25, uom: 'cm' }, status: 'A' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'sketchbook', qty: 80, size: { h: 14, w: 21, uom: 'cm' }, status: 'A' }"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'sketch pad', qty: 95, size: { h: 22.85, w: 30.5, uom: 'cm' }, status: 'A' }"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-49-menu" aria-describedby="select-49-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-50" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r92:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r92:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r92:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r92:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_ccow94xmz" class="leafygreen-ui-38lglc" id="_nj1flemlg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.insertMany(\n listOf(\n Document(\"item\", \"canvas\")\n .append(\"qty\", 100)\n .append(\"size\", Document(\"h\", 28).append(\"w\", 35.5).append(\"uom\", \"cm\"))\n .append(\"status\", \"A\"),\n Document(\"item\", \"journal\")\n .append(\"qty\", 25)\n .append(\"size\", Document(\"h\", 14).append(\"w\", 21).append(\"uom\", \"cm\"))\n .append(\"status\", \"A\"),\n Document(\"item\", \"mat\")\n .append(\"qty\", 85)\n .append(\"size\", Document(\"h\", 27.9).append(\"w\", 35.5).append(\"uom\", \"cm\"))\n .append(\"status\", \"A\"),\n Document(\"item\", \"mousepad\")\n .append(\"qty\", 25)\n .append(\"size\", Document(\"h\", 19).append(\"w\", 22.85).append(\"uom\", \"cm\"))\n .append(\"status\", \"P\"),\n Document(\"item\", \"notebook\")\n .append(\"qty\", 50)\n .append(\"size\", Document(\"h\", 8.5).append(\"w\", 11).append(\"uom\", \"in\"))\n .append(\"status\", \"P\"),\n Document(\"item\", \"paper\")\n .append(\"qty\", 100)\n .append(\"size\", Document(\"h\", 8.5).append(\"w\", 11).append(\"uom\", \"in\"))\n .append(\"status\", \"D\"),\n Document(\"item\", \"planner\")\n .append(\"qty\", 75)\n .append(\"size\", Document(\"h\", 22.85).append(\"w\", 30).append(\"uom\", \"cm\"))\n .append(\"status\", \"D\"),\n Document(\"item\", \"postcard\")\n .append(\"qty\", 45)\n .append(\"size\", Document(\"h\", 10).append(\"w\", 15.25).append(\"uom\", \"cm\"))\n .append(\"status\", \"A\"),\n Document(\"item\", \"sketchbook\")\n .append(\"qty\", 80)\n .append(\"size\", Document(\"h\", 14).append(\"w\", 21).append(\"uom\", \"cm\"))\n .append(\"status\", \"A\"),\n Document(\"item\", \"sketch pad\")\n .append(\"qty\", 95)\n .append(\"size\", Document(\"h\", 22.85).append(\"w\", 30.5).append(\"uom\", \"cm\"))\n .append(\"status\", \"A\"),\n )\n)","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-function">listOf</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"canvas"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">100</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">28</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">35.5</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"journal"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">25</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">14</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">21</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"mat"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">85</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">27.9</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">35.5</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"mousepad"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">25</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">19</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">22.85</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"notebook"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">50</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">8.5</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">11</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"in"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">100</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">8.5</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">11</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"in"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"D"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"planner"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">75</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">22.85</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">30</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"D"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"postcard"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">45</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">10</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">15.25</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"sketchbook"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">80</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">14</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">21</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"sketch pad"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">95</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"size"</span>, <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">"h"</span>, <span class="lg-highlight-number">22.85</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"w"</span>, <span class="lg-highlight-number">30.5</span>).<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"uom"</span>, <span class="lg-highlight-string">"cm"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">append</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"A"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-52-menu" aria-describedby="select-52-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-53" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r93:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r93:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r93:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r93:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_971n2vtwr" class="leafygreen-ui-38lglc" id="_6quitumos" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"await db.inventory.insert_many(\n [\n {\n \"item\": \"canvas\",\n \"qty\": 100,\n \"size\": {\"h\": 28, \"w\": 35.5, \"uom\": \"cm\"},\n \"status\": \"A\",\n },\n {\n \"item\": \"journal\",\n \"qty\": 25,\n \"size\": {\"h\": 14, \"w\": 21, \"uom\": \"cm\"},\n \"status\": \"A\",\n },\n {\n \"item\": \"mat\",\n \"qty\": 85,\n \"size\": {\"h\": 27.9, \"w\": 35.5, \"uom\": \"cm\"},\n \"status\": \"A\",\n },\n {\n \"item\": \"mousepad\",\n \"qty\": 25,\n \"size\": {\"h\": 19, \"w\": 22.85, \"uom\": \"cm\"},\n \"status\": \"P\",\n },\n {\n \"item\": \"notebook\",\n \"qty\": 50,\n \"size\": {\"h\": 8.5, \"w\": 11, \"uom\": \"in\"},\n \"status\": \"P\",\n },\n {\n \"item\": \"paper\",\n \"qty\": 100,\n \"size\": {\"h\": 8.5, \"w\": 11, \"uom\": \"in\"},\n \"status\": \"D\",\n },\n {\n \"item\": \"planner\",\n \"qty\": 75,\n \"size\": {\"h\": 22.85, \"w\": 30, \"uom\": \"cm\"},\n \"status\": \"D\",\n },\n {\n \"item\": \"postcard\",\n \"qty\": 45,\n \"size\": {\"h\": 10, \"w\": 15.25, \"uom\": \"cm\"},\n \"status\": \"A\",\n },\n {\n \"item\": \"sketchbook\",\n \"qty\": 80,\n \"size\": {\"h\": 14, \"w\": 21, \"uom\": \"cm\"},\n \"status\": \"A\",\n },\n {\n \"item\": \"sketch pad\",\n \"qty\": 95,\n \"size\": {\"h\": 22.85, \"w\": 30.5, \"uom\": \"cm\"},\n \"status\": \"A\",\n },\n ]\n)","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">await</span> db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">insert_many</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"canvas"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">28</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"journal"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">21</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"mat"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">85</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">27.9</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"mousepad"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">19</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"P"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"notebook"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">50</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"in"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"P"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"paper"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"in"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"D"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"planner"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">75</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">30</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"D"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"postcard"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">45</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">15.25</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"sketchbook"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">80</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">21</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"sketch pad"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">95</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">30.5</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-55-menu" aria-describedby="select-55-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-56" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r94:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r94:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r94:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r94:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_dmuqdxsfr" class="" id="_2uhbpzuzk" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"await db.collection('inventory').insertMany([\n {\n item: 'canvas',\n qty: 100,\n size: { h: 28, w: 35.5, uom: 'cm' },\n status: 'A'\n },\n {\n item: 'journal',\n qty: 25,\n size: { h: 14, w: 21, uom: 'cm' },\n status: 'A'\n },\n {\n item: 'mat',\n qty: 85,\n size: { h: 27.9, w: 35.5, uom: 'cm' },\n status: 'A'\n },\n {\n item: 'mousepad',\n qty: 25,\n size: { h: 19, w: 22.85, uom: 'cm' },\n status: 'P'\n },\n {\n item: 'notebook',\n qty: 50,\n size: { h: 8.5, w: 11, uom: 'in' },\n status: 'P'\n },\n {\n item: 'paper',\n qty: 100,\n size: { h: 8.5, w: 11, uom: 'in' },\n status: 'D'\n },\n {\n item: 'planner',\n qty: 75,\n size: { h: 22.85, w: 30, uom: 'cm' },\n status: 'D'\n },\n {\n item: 'postcard',\n qty: 45,\n size: { h: 10, w: 15.25, uom: 'cm' },\n status: 'A'\n },\n {\n item: 'sketchbook',\n qty: 80,\n size: { h: 14, w: 21, uom: 'cm' },\n status: 'A'\n },\n {\n item: 'sketch pad',\n qty: 95,\n size: { h: 22.85, w: 30.5, uom: 'cm' },\n status: 'A'\n }\n]);","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">await</span> db.<span class="lg-highlight-title lg-highlight-function">collection</span>(<span class="lg-highlight-string">'inventory'</span>).<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'canvas'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">28</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'A'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'journal'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">21</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'A'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'mat'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">85</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">27.9</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'A'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'mousepad'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">19</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'P'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'notebook'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">50</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'in'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'P'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'paper'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'in'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'D'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'planner'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">75</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">30</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'D'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'postcard'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">45</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">15.25</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'A'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'sketchbook'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">80</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">21</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'A'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'sketch pad'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">95</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">30.5</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'A'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-58-menu" aria-describedby="select-58-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-59" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r95:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r95:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r95:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r95:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_uytyzasv9" class="leafygreen-ui-38lglc" id="_6f2a63knm" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$db-&gt;coll(\"inventory\")-&gt;insert_many(\n [\n {\n item =&gt; \"canvas\",\n qty =&gt; 100,\n size =&gt; { h =&gt; 28, w =&gt; 35.5, uom =&gt; \"cm\" },\n status =&gt; \"A\"\n },\n {\n item =&gt; \"journal\",\n qty =&gt; 25,\n size =&gt; { h =&gt; 14, w =&gt; 21, uom =&gt; \"cm\" },\n status =&gt; \"A\"\n },\n {\n item =&gt; \"mat\",\n qty =&gt; 85,\n size =&gt; { h =&gt; 27.9, w =&gt; 35.5, uom =&gt; \"cm\" },\n status =&gt; \"A\"\n },\n {\n item =&gt; \"mousepad\",\n qty =&gt; 25,\n size =&gt; { h =&gt; 19, w =&gt; 22.85, uom =&gt; \"cm\" },\n status =&gt; \"P\"\n },\n {\n item =&gt; \"notebook\",\n qty =&gt; 50,\n size =&gt; { h =&gt; 8.5, w =&gt; 11, uom =&gt; \"in\" },\n status =&gt; \"P\"\n },\n {\n item =&gt; \"paper\",\n qty =&gt; 100,\n size =&gt; { h =&gt; 8.5, w =&gt; 11, uom =&gt; \"in\" },\n status =&gt; \"D\"\n },\n {\n item =&gt; \"planner\",\n qty =&gt; 75,\n size =&gt; { h =&gt; 22.85, w =&gt; 30, uom =&gt; \"cm\" },\n status =&gt; \"D\"\n },\n {\n item =&gt; \"postcard\",\n qty =&gt; 45,\n size =&gt; { h =&gt; 10, w =&gt; 15.25, uom =&gt; \"cm\" },\n status =&gt; \"A\"\n },\n {\n item =&gt; \"sketchbook\",\n qty =&gt; 80,\n size =&gt; { h =&gt; 14, w =&gt; 21, uom =&gt; \"cm\" },\n status =&gt; \"A\"\n },\n {\n item =&gt; \"sketch pad\",\n qty =&gt; 95,\n size =&gt; { h =&gt; 22.85, w =&gt; 30.5, uom =&gt; \"cm\" },\n status =&gt; \"A\"\n }\n ]\n);","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$db<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">coll</span>(<span class="lg-highlight-string">"inventory"</span>)<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">insert_many</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"canvas"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">size</span><!-- --><span class="lg-highlight-function"> =&gt;</span> { <span class="lg-highlight-params lg-highlight-function">h</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">28</span>, <span class="lg-highlight-params lg-highlight-function">w</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-params lg-highlight-function">uom</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"cm"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">status</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"A"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"journal"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">size</span><!-- --><span class="lg-highlight-function"> =&gt;</span> { <span class="lg-highlight-params lg-highlight-function">h</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">14</span>, <span class="lg-highlight-params lg-highlight-function">w</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">21</span>, <span class="lg-highlight-params lg-highlight-function">uom</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"cm"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">status</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"A"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"mat"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">85</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">size</span><!-- --><span class="lg-highlight-function"> =&gt;</span> { <span class="lg-highlight-params lg-highlight-function">h</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">27.9</span>, <span class="lg-highlight-params lg-highlight-function">w</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-params lg-highlight-function">uom</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"cm"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">status</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"A"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"mousepad"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">size</span><!-- --><span class="lg-highlight-function"> =&gt;</span> { <span class="lg-highlight-params lg-highlight-function">h</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">19</span>, <span class="lg-highlight-params lg-highlight-function">w</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-params lg-highlight-function">uom</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"cm"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">status</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"P"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"notebook"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">50</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">size</span><!-- --><span class="lg-highlight-function"> =&gt;</span> { <span class="lg-highlight-params lg-highlight-function">h</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-params lg-highlight-function">w</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">11</span>, <span class="lg-highlight-params lg-highlight-function">uom</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"in"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">status</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"P"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"paper"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">size</span><!-- --><span class="lg-highlight-function"> =&gt;</span> { <span class="lg-highlight-params lg-highlight-function">h</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-params lg-highlight-function">w</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">11</span>, <span class="lg-highlight-params lg-highlight-function">uom</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"in"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">status</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"D"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"planner"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">75</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">size</span><!-- --><span class="lg-highlight-function"> =&gt;</span> { <span class="lg-highlight-params lg-highlight-function">h</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-params lg-highlight-function">w</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">30</span>, <span class="lg-highlight-params lg-highlight-function">uom</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"cm"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">status</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"D"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"postcard"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">45</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">size</span><!-- --><span class="lg-highlight-function"> =&gt;</span> { <span class="lg-highlight-params lg-highlight-function">h</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">10</span>, <span class="lg-highlight-params lg-highlight-function">w</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">15.25</span>, <span class="lg-highlight-params lg-highlight-function">uom</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"cm"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">status</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"A"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"sketchbook"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">80</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">size</span><!-- --><span class="lg-highlight-function"> =&gt;</span> { <span class="lg-highlight-params lg-highlight-function">h</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">14</span>, <span class="lg-highlight-params lg-highlight-function">w</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">21</span>, <span class="lg-highlight-params lg-highlight-function">uom</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"cm"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">status</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"A"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"sketch pad"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">95</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">size</span><!-- --><span class="lg-highlight-function"> =&gt;</span> { <span class="lg-highlight-params lg-highlight-function">h</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-params lg-highlight-function">w</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">30.5</span>, <span class="lg-highlight-params lg-highlight-function">uom</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"cm"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">status</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"A"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-61-menu" aria-describedby="select-61-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-62" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r96:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r96:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r96:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r96:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_zx592wwj9" class="leafygreen-ui-38lglc" id="_eqao0ga7y" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$insertManyResult = $db-&gt;inventory-&gt;insertMany([\n [\n 'item' =&gt; 'canvas',\n 'qty' =&gt; 100,\n 'size' =&gt; ['h' =&gt; 28, 'w' =&gt; 35.5, 'uom' =&gt; 'cm'],\n 'status' =&gt; 'A',\n ],\n [\n 'item' =&gt; 'journal',\n 'qty' =&gt; 25,\n 'size' =&gt; ['h' =&gt; 14, 'w' =&gt; 21, 'uom' =&gt; 'cm'],\n 'status' =&gt; 'A',\n ],\n [\n 'item' =&gt; 'mat',\n 'qty' =&gt; 85,\n 'size' =&gt; ['h' =&gt; 27.9, 'w' =&gt; 35.5, 'uom' =&gt; 'cm'],\n 'status' =&gt; 'A',\n ],\n [\n 'item' =&gt; 'mousepad',\n 'qty' =&gt; 25,\n 'size' =&gt; ['h' =&gt; 19, 'w' =&gt; 22.85, 'uom' =&gt; 'cm'],\n 'status' =&gt; 'P',\n ],\n [\n 'item' =&gt; 'notebook',\n 'qty' =&gt; 50,\n 'size' =&gt; ['h' =&gt; 8.5, 'w' =&gt; 11, 'uom' =&gt; 'in'],\n 'status' =&gt; 'P',\n ],\n [\n 'item' =&gt; 'paper',\n 'qty' =&gt; 100,\n 'size' =&gt; ['h' =&gt; 8.5, 'w' =&gt; 11, 'uom' =&gt; 'in'],\n 'status' =&gt; 'D',\n ],\n [\n 'item' =&gt; 'planner',\n 'qty' =&gt; 75,\n 'size' =&gt; ['h' =&gt; 22.85, 'w' =&gt; 30, 'uom' =&gt; 'cm'],\n 'status' =&gt; 'D',\n ],\n [\n 'item' =&gt; 'postcard',\n 'qty' =&gt; 45,\n 'size' =&gt; ['h' =&gt; 10, 'w' =&gt; 15.25, 'uom' =&gt; 'cm'],\n 'status' =&gt; 'A',\n ],\n [\n 'item' =&gt; 'sketchbook',\n 'qty' =&gt; 80,\n 'size' =&gt; ['h' =&gt; 14, 'w' =&gt; 21, 'uom' =&gt; 'cm'],\n 'status' =&gt; 'A',\n ],\n [\n 'item' =&gt; 'sketch pad',\n 'qty' =&gt; 95,\n 'size' =&gt; ['h' =&gt; 22.85, 'w' =&gt; 30.5, 'uom' =&gt; 'cm'],\n 'status' =&gt; 'A',\n ],\n]);","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$insertManyResult = $db-&gt;inventory-&gt;<span class="lg-highlight-title lg-highlight-function">insertMany</span>([</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'canvas'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'size'</span> =&gt; [<span class="lg-highlight-string">'h'</span> =&gt; <span class="lg-highlight-number">28</span>, <span class="lg-highlight-string">'w'</span> =&gt; <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-string">'uom'</span> =&gt; <span class="lg-highlight-string">'cm'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'status'</span> =&gt; <span class="lg-highlight-string">'A'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'journal'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'size'</span> =&gt; [<span class="lg-highlight-string">'h'</span> =&gt; <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">'w'</span> =&gt; <span class="lg-highlight-number">21</span>, <span class="lg-highlight-string">'uom'</span> =&gt; <span class="lg-highlight-string">'cm'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'status'</span> =&gt; <span class="lg-highlight-string">'A'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'mat'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">85</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'size'</span> =&gt; [<span class="lg-highlight-string">'h'</span> =&gt; <span class="lg-highlight-number">27.9</span>, <span class="lg-highlight-string">'w'</span> =&gt; <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-string">'uom'</span> =&gt; <span class="lg-highlight-string">'cm'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'status'</span> =&gt; <span class="lg-highlight-string">'A'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'mousepad'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'size'</span> =&gt; [<span class="lg-highlight-string">'h'</span> =&gt; <span class="lg-highlight-number">19</span>, <span class="lg-highlight-string">'w'</span> =&gt; <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-string">'uom'</span> =&gt; <span class="lg-highlight-string">'cm'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'status'</span> =&gt; <span class="lg-highlight-string">'P'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'notebook'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">50</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'size'</span> =&gt; [<span class="lg-highlight-string">'h'</span> =&gt; <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-string">'w'</span> =&gt; <span class="lg-highlight-number">11</span>, <span class="lg-highlight-string">'uom'</span> =&gt; <span class="lg-highlight-string">'in'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'status'</span> =&gt; <span class="lg-highlight-string">'P'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'paper'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'size'</span> =&gt; [<span class="lg-highlight-string">'h'</span> =&gt; <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-string">'w'</span> =&gt; <span class="lg-highlight-number">11</span>, <span class="lg-highlight-string">'uom'</span> =&gt; <span class="lg-highlight-string">'in'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'status'</span> =&gt; <span class="lg-highlight-string">'D'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'planner'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">75</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'size'</span> =&gt; [<span class="lg-highlight-string">'h'</span> =&gt; <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-string">'w'</span> =&gt; <span class="lg-highlight-number">30</span>, <span class="lg-highlight-string">'uom'</span> =&gt; <span class="lg-highlight-string">'cm'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'status'</span> =&gt; <span class="lg-highlight-string">'D'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'postcard'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">45</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'size'</span> =&gt; [<span class="lg-highlight-string">'h'</span> =&gt; <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">'w'</span> =&gt; <span class="lg-highlight-number">15.25</span>, <span class="lg-highlight-string">'uom'</span> =&gt; <span class="lg-highlight-string">'cm'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'status'</span> =&gt; <span class="lg-highlight-string">'A'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'sketchbook'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">80</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'size'</span> =&gt; [<span class="lg-highlight-string">'h'</span> =&gt; <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">'w'</span> =&gt; <span class="lg-highlight-number">21</span>, <span class="lg-highlight-string">'uom'</span> =&gt; <span class="lg-highlight-string">'cm'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'status'</span> =&gt; <span class="lg-highlight-string">'A'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'sketch pad'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">95</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'size'</span> =&gt; [<span class="lg-highlight-string">'h'</span> =&gt; <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-string">'w'</span> =&gt; <span class="lg-highlight-number">30.5</span>, <span class="lg-highlight-string">'uom'</span> =&gt; <span class="lg-highlight-string">'cm'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'status'</span> =&gt; <span class="lg-highlight-string">'A'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-64-menu" aria-describedby="select-64-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-65" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r97:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r97:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r97:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r97:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_m60p8j232" class="leafygreen-ui-38lglc" id="_fo3azcwzs" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.insert_many(\n [\n {\n \"item\": \"canvas\",\n \"qty\": 100,\n \"size\": {\"h\": 28, \"w\": 35.5, \"uom\": \"cm\"},\n \"status\": \"A\",\n },\n {\n \"item\": \"journal\",\n \"qty\": 25,\n \"size\": {\"h\": 14, \"w\": 21, \"uom\": \"cm\"},\n \"status\": \"A\",\n },\n {\n \"item\": \"mat\",\n \"qty\": 85,\n \"size\": {\"h\": 27.9, \"w\": 35.5, \"uom\": \"cm\"},\n \"status\": \"A\",\n },\n {\n \"item\": \"mousepad\",\n \"qty\": 25,\n \"size\": {\"h\": 19, \"w\": 22.85, \"uom\": \"cm\"},\n \"status\": \"P\",\n },\n {\n \"item\": \"notebook\",\n \"qty\": 50,\n \"size\": {\"h\": 8.5, \"w\": 11, \"uom\": \"in\"},\n \"status\": \"P\",\n },\n {\n \"item\": \"paper\",\n \"qty\": 100,\n \"size\": {\"h\": 8.5, \"w\": 11, \"uom\": \"in\"},\n \"status\": \"D\",\n },\n {\n \"item\": \"planner\",\n \"qty\": 75,\n \"size\": {\"h\": 22.85, \"w\": 30, \"uom\": \"cm\"},\n \"status\": \"D\",\n },\n {\n \"item\": \"postcard\",\n \"qty\": 45,\n \"size\": {\"h\": 10, \"w\": 15.25, \"uom\": \"cm\"},\n \"status\": \"A\",\n },\n {\n \"item\": \"sketchbook\",\n \"qty\": 80,\n \"size\": {\"h\": 14, \"w\": 21, \"uom\": \"cm\"},\n \"status\": \"A\",\n },\n {\n \"item\": \"sketch pad\",\n \"qty\": 95,\n \"size\": {\"h\": 22.85, \"w\": 30.5, \"uom\": \"cm\"},\n \"status\": \"A\",\n },\n ]\n)","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">insert_many</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"canvas"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">28</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"journal"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">21</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"mat"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">85</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">27.9</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"mousepad"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">19</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"P"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"notebook"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">50</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"in"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"P"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"paper"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"in"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"D"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"planner"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">75</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">30</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"D"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"postcard"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">45</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">15.25</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"sketchbook"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">80</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">21</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"sketch pad"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">95</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size"</span>: {<span class="lg-highlight-string">"h"</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-string">"w"</span>: <span class="lg-highlight-number">30.5</span>, <span class="lg-highlight-string">"uom"</span>: <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"A"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-67-menu" aria-describedby="select-67-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-68" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r98:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r98:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r98:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r98:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_r6nxvbvli" class="leafygreen-ui-38lglc" id="_i8o8s71r5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client[:inventory].insert_many([\n { item: 'canvas',\n qty: 100,\n size: { h: 28, w: 35.5, uom: 'cm' },\n status: 'A' },\n { item: 'journal',\n qty: 25,\n size: { h: 14, w: 21, uom: 'cm' },\n status: 'A' },\n { item: 'mat',\n qty: 85,\n size: { h: 27.9, w: 35.5, uom: 'cm' },\n status: 'A' },\n { item: 'mousepad',\n qty: 25,\n size: { h: 19, w: 22.85, uom: 'cm' },\n status: 'P' },\n { item: 'notebook',\n qty: 50,\n size: { h: 8.5, w: 11, uom: 'in' },\n status: 'P' },\n { item: 'paper',\n qty: 100,\n size: { h: 8.5, w: 11, uom: 'in' },\n status: 'D' },\n { item: 'planner',\n qty: 75,\n size: { h: 22.85, w: 30, uom: 'cm' },\n status: 'D' },\n { item: 'postcard',\n qty: 45,\n size: { h: 10, w: 15.25, uom: 'cm' },\n status: 'A' },\n { item: 'sketchbook',\n qty: 80,\n size: { h: 14, w: 21, uom: 'cm' },\n status: 'A' },\n { item: 'sketch pad',\n qty: 95,\n size: { h: 22.85, w: 30.5, uom: 'cm' },\n status: 'A' }\n ])","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client<!-- -->[<!-- -->:inventory].<span class="lg-highlight-title lg-highlight-function">insert_many</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'canvas'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">28</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'A'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'journal'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">21</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'A'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'mat'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">85</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">27.9</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">35.5</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'A'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'mousepad'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">25</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">19</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'P'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'notebook'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">50</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'in'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'P'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'paper'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">100</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">8.5</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'in'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'D'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'planner'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">75</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">30</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'D'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'postcard'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">45</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">15.25</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'A'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'sketchbook'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">80</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">21</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'A'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'sketch pad'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">95</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">size</span>: <!-- -->{ <span class="lg-highlight-attr">h</span>: <span class="lg-highlight-number">22.85</span>, <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">30.5</span>, <span class="lg-highlight-attr">uom</span>: <span class="lg-highlight-string">'cm'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'A'</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-70-menu" aria-describedby="select-70-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-71" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r99:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r99:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r99:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r99:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_nbytzytce" class="leafygreen-ui-38lglc" id="_zsjubopty" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.insertMany(Seq(\n Document(\"\"\"{ item: \"canvas\", qty: 100, size: { h: 28, w: 35.5, uom: \"cm\" }, status: \"A\" }\"\"\"),\n Document(\"\"\"{ item: \"journal\", qty: 25, size: { h: 14, w: 21, uom: \"cm\" }, status: \"A\" }\"\"\"),\n Document(\"\"\"{ item: \"mat\", qty: 85, size: { h: 27.9, w: 35.5, uom: \"cm\" }, status: \"A\" }\"\"\"),\n Document(\"\"\"{ item: \"mousepad\", qty: 25, size: { h: 19, w: 22.85, uom: \"cm\" }, status: \"P\" }\"\"\"),\n Document(\"\"\"{ item: \"notebook\", qty: 50, size: { h: 8.5, w: 11, uom: \"in\" }, status: \"P\" }\"\"\"),\n Document(\"\"\"{ item: \"paper\", qty: 100, size: { h: 8.5, w: 11, uom: \"in\" }, status: \"D\" }\"\"\"),\n Document(\"\"\"{ item: \"planner\", qty: 75, size: { h: 22.85, w: 30, uom: \"cm\" }, status: \"D\" }\"\"\"),\n Document(\"\"\"{ item: \"postcard\", qty: 45, size: { h: 10, w: 15.25, uom: \"cm\" }, status: \"A\" }\"\"\"),\n Document(\"\"\"{ item: \"sketchbook\", qty: 80, size: { h: 14, w: 21, uom: \"cm\" }, status: \"A\" }\"\"\"),\n Document(\"\"\"{ item: \"sketch pad\", qty: 95, size: { h: 22.85, w: 30.5, uom: \"cm\" }, status: \"A\" }\"\"\")\n)).execute()","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<span class="lg-highlight-title lg-highlight-class">Seq</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>canvas<span class="lg-highlight-string">", qty: 100, size: { h: 28, w: 35.5, uom: "</span>cm<span class="lg-highlight-string">" }, status: "</span>A<span class="lg-highlight-string">" }"</span><span class="lg-highlight-string">""</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>journal<span class="lg-highlight-string">", qty: 25, size: { h: 14, w: 21, uom: "</span>cm<span class="lg-highlight-string">" }, status: "</span>A<span class="lg-highlight-string">" }"</span><span class="lg-highlight-string">""</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>mat<span class="lg-highlight-string">", qty: 85, size: { h: 27.9, w: 35.5, uom: "</span>cm<span class="lg-highlight-string">" }, status: "</span>A<span class="lg-highlight-string">" }"</span><span class="lg-highlight-string">""</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>mousepad<span class="lg-highlight-string">", qty: 25, size: { h: 19, w: 22.85, uom: "</span>cm<span class="lg-highlight-string">" }, status: "</span>P<span class="lg-highlight-string">" }"</span><span class="lg-highlight-string">""</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>notebook<span class="lg-highlight-string">", qty: 50, size: { h: 8.5, w: 11, uom: "</span><span class="lg-highlight-keyword">in</span><span class="lg-highlight-string">" }, status: "</span>P<span class="lg-highlight-string">" }"</span><span class="lg-highlight-string">""</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>paper<span class="lg-highlight-string">", qty: 100, size: { h: 8.5, w: 11, uom: "</span><span class="lg-highlight-keyword">in</span><span class="lg-highlight-string">" }, status: "</span>D<span class="lg-highlight-string">" }"</span><span class="lg-highlight-string">""</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>planner<span class="lg-highlight-string">", qty: 75, size: { h: 22.85, w: 30, uom: "</span>cm<span class="lg-highlight-string">" }, status: "</span>D<span class="lg-highlight-string">" }"</span><span class="lg-highlight-string">""</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>postcard<span class="lg-highlight-string">", qty: 45, size: { h: 10, w: 15.25, uom: "</span>cm<span class="lg-highlight-string">" }, status: "</span>A<span class="lg-highlight-string">" }"</span><span class="lg-highlight-string">""</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>sketchbook<span class="lg-highlight-string">", qty: 80, size: { h: 14, w: 21, uom: "</span>cm<span class="lg-highlight-string">" }, status: "</span>A<span class="lg-highlight-string">" }"</span><span class="lg-highlight-string">""</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>sketch pad<span class="lg-highlight-string">", qty: 95, size: { h: 22.85, w: 30.5, uom: "</span>cm<span class="lg-highlight-string">" }, status: "</span>A<span class="lg-highlight-string">" }"</span><span class="lg-highlight-string">""</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)).<span class="lg-highlight-title lg-highlight-function">execute</span>()</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-73-menu" aria-describedby="select-73-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-74" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9a:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9a:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9a:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9a:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-update-documents-modifiers"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Update Documents in a Collection <a class="headerlink leafygreen-ui-1kepx47" href="#update-documents-in-a-collection" 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="update-documents-in-a-collection"> </div> </a> </h2> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-7"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_lier9902k" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0hbwtvybj" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_az9ce2r9s" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_a5qwrk6a8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_zrmqedhjs" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_isyeabjm3" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_vnu0shgsy" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_bh1xakwjn" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_ir6lnl1ks" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_zg2vwwn9x" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_08i842z35" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_82o2smlvu" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_gflhxwv3i" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fg7zkrwsh" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_lwm1bmwpx" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_yu2j1ciw9" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_rv0rdk686" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_39c50x1ng" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_gz83yi34u" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5b5r6ende" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_gdcbs5e1z" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_12ockqh9m" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_ty4931t45" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_x8wzizo2i" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_3nf68wlhs" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_gaf23pm83" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_7jm1m8lud" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_j9opzz5ys" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_8i6zu7y4m" class="leafygreen-ui-38lglc" id="_n1v1awcv6" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document, MongoDB provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/reference/operator/update/" target="_self"> <span> update operators </span> </a> , such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , to modify field values. </p> <p class="leafygreen-ui-1kp3ins"> To use the update operators, pass to the update methods an update document of the form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n &lt;update&gt;: { &lt;field1&gt;: &lt;value1&gt;, ... },\n &lt;update&gt;: { &lt;field2&gt;: &lt;value2&gt;, ... },\n ...\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->&lt;update operator&gt;: { &lt;field1&gt;: &lt;value1&gt;, ... },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;update operator&gt;: { &lt;field2&gt;: &lt;value2&gt;, ... },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-76-menu" aria-describedby="select-76-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-77" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9b:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9b:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9b:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9b:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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"> Some update operators, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , will create the field if the field does not exist. See the individual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operator </a> reference for details. </p> </div> </div> </div> <div> <div aria-labelledby="_44hdv99d5" class="leafygreen-ui-38lglc" id="_fkq7oof93" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document in Compass, hover over the target document and click the pencil icon: </p> <div class="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:1504px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='808'%20width='1504'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Click edit document" data-main-image="" decoding="async" height="808" loading="lazy" sizes="(min-width: 1504px) 1504px, 100vw" src="/docs/manual/static/1e81ba91b2d97277fced97fe9047e31f/be780/compass-update-doc-button.webp" srcset="/docs/manual/static/1e81ba91b2d97277fced97fe9047e31f/ecfc3/compass-update-doc-button.webp 376w,/docs/manual/static/1e81ba91b2d97277fced97fe9047e31f/82c4f/compass-update-doc-button.webp 752w,/docs/manual/static/1e81ba91b2d97277fced97fe9047e31f/be780/compass-update-doc-button.webp 1504w" style="--border-color:#C1C7C6;opacity:0" width="1504"/> <noscript> <img alt="Click edit document" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="808" loading="lazy" sizes="(min-width: 1504px) 1504px, 100vw" src="/docs/manual/static/1e81ba91b2d97277fced97fe9047e31f/be780/compass-update-doc-button.webp" srcset="/docs/manual/static/1e81ba91b2d97277fced97fe9047e31f/ecfc3/compass-update-doc-button.webp 376w,/docs/manual/static/1e81ba91b2d97277fced97fe9047e31f/82c4f/compass-update-doc-button.webp 752w,/docs/manual/static/1e81ba91b2d97277fced97fe9047e31f/be780/compass-update-doc-button.webp 1504w" style="--border-color:#C1C7C6;opacity:0" width="1504"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> <p class="leafygreen-ui-1kp3ins"> After clicking the pencil icon, the document enters edit mode: </p> <div class="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:1424px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='310'%20width='1424'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Document edit mode" data-main-image="" decoding="async" height="310" loading="lazy" sizes="(min-width: 1424px) 1424px, 100vw" src="/docs/manual/static/a871a23474b6b54234970d338dcb6cc5/2917f/compass-update-edit-mode.webp" srcset="/docs/manual/static/a871a23474b6b54234970d338dcb6cc5/51865/compass-update-edit-mode.webp 356w,/docs/manual/static/a871a23474b6b54234970d338dcb6cc5/2e861/compass-update-edit-mode.webp 712w,/docs/manual/static/a871a23474b6b54234970d338dcb6cc5/2917f/compass-update-edit-mode.webp 1424w" style="--border-color:#C1C7C6;opacity:0" width="1424"/> <noscript> <img alt="Document edit mode" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="310" loading="lazy" sizes="(min-width: 1424px) 1424px, 100vw" src="/docs/manual/static/a871a23474b6b54234970d338dcb6cc5/2917f/compass-update-edit-mode.webp" srcset="/docs/manual/static/a871a23474b6b54234970d338dcb6cc5/51865/compass-update-edit-mode.webp 356w,/docs/manual/static/a871a23474b6b54234970d338dcb6cc5/2e861/compass-update-edit-mode.webp 712w,/docs/manual/static/a871a23474b6b54234970d338dcb6cc5/2917f/compass-update-edit-mode.webp 1424w" style="--border-color:#C1C7C6;opacity:0" width="1424"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> <p class="leafygreen-ui-1kp3ins"> You can now change the this document by clicking the item you wish to change and modifying the value. </p> <p class="leafygreen-ui-1kp3ins"> For detailed instructions on updating documents in Compass, refer to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/compass/current/documents/modify/#std-label-compass-modify-documents" target="_self"> <span> Compass documentation </span> </a> or follow the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-write-op-updateOne" target="_self"> <span> example </span> </a> below. </p> <p class="leafygreen-ui-1kp3ins"> Once you are satisfied with your changes, click <span class="guilabel css-h15tq0"> Update </span> to save the updated document. </p> <p class="leafygreen-ui-1kp3ins"> Click <span class="guilabel css-h15tq0"> Cancel </span> to revert any modifications made to the document and exit edit mode. </p> </div> </div> </div> <div> <div aria-labelledby="_b5sk75z2o" class="leafygreen-ui-38lglc" id="_3civqtm5m" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document, MongoDB provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/reference/operator/update/" target="_self"> <span> update operators </span> </a> such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> to modify field values. </p> <p class="leafygreen-ui-1kp3ins"> To use the update operators, pass to the update methods an update document of the form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n &lt;update&gt; =&gt; { &lt;field1&gt; =&gt; &lt;value1&gt;, ... },\n &lt;update&gt; =&gt; { &lt;field2&gt; =&gt; &lt;value2&gt;, ... },\n ...\n}","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;update operator&gt; =&gt; { &lt;field1&gt; =&gt; &lt;value1&gt;, ... },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;update operator&gt; =&gt; { &lt;field2&gt; =&gt; &lt;value2&gt;, ... },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-79-menu" aria-describedby="select-79-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-80" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9c:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9c:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9c:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9c:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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"> Some update operators, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , will create the field if the field does not exist. See the individual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operator </a> reference for details. </p> </div> </div> </div> <div> <div aria-labelledby="_swfnyhwdi" class="leafygreen-ui-38lglc" id="_xwlr3j9nz" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document, MongoDB provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/reference/operator/update/" target="_self"> <span> update operators </span> </a> such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> to modify field values. </p> <p class="leafygreen-ui-1kp3ins"> Some update operators, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , will create the field if the field does not exist. See the individual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operator </a> reference for details. </p> </div> </div> </div> <div> <div aria-labelledby="_nbp4ua4z9" class="leafygreen-ui-38lglc" id="_ylqsybhj1" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document, MongoDB provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/reference/operator/update/" target="_self"> <span> update operators </span> </a> such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> to modify field values. </p> <p class="leafygreen-ui-1kp3ins"> The driver provides the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/model/Updates.html" rel="noopener noreferrer"> <span> com.mongodb.client.model.Updates </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> class to facilitate the creation of update documents. For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"combine(set(&lt;field1&gt;, &lt;value1&gt;), set(&lt;field2&gt;, &lt;value2&gt;))","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">combine</span>(<span class="lg-highlight-title lg-highlight-function">set</span>(&lt;field1&gt;, &lt;value1&gt;), <span class="lg-highlight-title lg-highlight-function">set</span>(&lt;field2&gt;, &lt;value2&gt;))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-82-menu" aria-describedby="select-82-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-83" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9d:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9d:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9d:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9d:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For a list of the update helpers, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/model/Updates.html" rel="noopener noreferrer"> <span> com.mongodb.client.model.Updates <!-- --> . </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> <p class="leafygreen-ui-1kp3ins"> Some update operators, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , will create the field if the field does not exist. See the individual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operator </a> reference for details. </p> </div> </div> </div> <div> <div aria-labelledby="_1zfp3lkki" class="leafygreen-ui-38lglc" id="_wgekgst31" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document, MongoDB provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/reference/operator/update/" target="_self"> <span> update operators </span> </a> such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> to modify field values. </p> <p class="leafygreen-ui-1kp3ins"> The driver provides the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/model/Updates.html" rel="noopener noreferrer"> <span> com.mongodb.client.model.Updates </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> class to facilitate the creation of update documents. For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"combine(set(&lt;field1&gt;, &lt;value1&gt;), set(&lt;field2&gt;, &lt;value2&gt;))","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">combine</span>(<span class="lg-highlight-title lg-highlight-function">set</span>(&lt;field1&gt;, &lt;value1&gt;), <span class="lg-highlight-title lg-highlight-function">set</span>(&lt;field2&gt;, &lt;value2&gt;))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-85-menu" aria-describedby="select-85-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-86" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9e:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9e:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9e:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9e:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For a list of the update helpers, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/model/Updates.html" rel="noopener noreferrer"> <span> com.mongodb.client.model.Updates <!-- --> . </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> <p class="leafygreen-ui-1kp3ins"> Some update operators, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , will create the field if the field does not exist. See the individual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operator </a> reference for details. </p> </div> </div> </div> <div> <div aria-labelledby="_fjurpjs1c" class="leafygreen-ui-38lglc" id="_8d37y0umk" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document, MongoDB provides <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators"> update operators </a> such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> to modify field values. </p> <p class="leafygreen-ui-1kp3ins"> The driver provides the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html" rel="noopener noreferrer"> <span> com.mongodb.client.model.Updates </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> class to facilitate the creation of update documents. The following code shows an update document that uses methods from the <code class="leafygreen-ui-1l06pbn"> Updates </code> builder class: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"combine(set(&lt;field1&gt;, &lt;value1&gt;), set(&lt;field2&gt;, &lt;value2&gt;))","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">combine</span>(<span class="lg-highlight-title lg-highlight-function">set</span>(&lt;field1&gt;, &lt;value1&gt;), <span class="lg-highlight-title lg-highlight-function">set</span>(&lt;field2&gt;, &lt;value2&gt;))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-88-menu" aria-describedby="select-88-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-89" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9f:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9f:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9f:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9f:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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"> Some update operators, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , will create the field if the field does not exist. See the individual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operator </a> reference for details. </p> </div> </div> </div> <div> <div aria-labelledby="_i922eyfz6" class="leafygreen-ui-38lglc" id="_4u3ohn2uk" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document, MongoDB provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/reference/operator/update/" target="_self"> <span> update operators </span> </a> such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> to modify field values. </p> <p class="leafygreen-ui-1kp3ins"> To use the update operators, pass to the update methods an update document of the form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n &lt;update&gt;: { &lt;field1&gt;: &lt;value1&gt;, ... },\n &lt;update&gt;: { &lt;field2&gt;: &lt;value2&gt;, ... },\n ...\n}","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;update operator&gt;: { &lt;field1&gt;: &lt;value1&gt;, ... },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;update operator&gt;: { &lt;field2&gt;: &lt;value2&gt;, ... },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-91-menu" aria-describedby="select-91-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-92" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9g:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9g:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9g:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9g:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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"> Some update operators, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , will create the field if the field does not exist. See the individual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operator </a> reference for details. </p> </div> </div> </div> <div> <div aria-labelledby="_xla3n2o5x" class="" id="_82ujkeheq" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document, MongoDB provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/reference/operator/update/" target="_self"> <span> update operators </span> </a> such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> to modify field values. </p> <p class="leafygreen-ui-1kp3ins"> To use the update operators, pass to the update methods an update document of the form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n &lt;update&gt;: { &lt;field1&gt;: &lt;value1&gt;, ... },\n &lt;update&gt;: { &lt;field2&gt;: &lt;value2&gt;, ... },\n ...\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->&lt;update operator&gt;: { &lt;field1&gt;: &lt;value1&gt;, ... },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;update operator&gt;: { &lt;field2&gt;: &lt;value2&gt;, ... },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-94-menu" aria-describedby="select-94-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-95" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9h:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9h:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9h:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9h:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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"> Some update operators, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , will create the field if the field does not exist. See the individual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operator </a> reference for details. </p> </div> </div> </div> <div> <div aria-labelledby="_beyr629q3" class="leafygreen-ui-38lglc" id="_a70pqy43n" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document, MongoDB provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/reference/operator/update/" target="_self"> <span> update operators </span> </a> such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> to modify field values. </p> <p class="leafygreen-ui-1kp3ins"> To use the update operators, pass to the update methods an update document of the form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n &lt;update&gt; =&gt; { &lt;field1&gt; =&gt; &lt;value1&gt;, ... },\n &lt;update&gt; =&gt; { &lt;field2&gt; =&gt; &lt;value2&gt;, ... },\n ...\n}","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->&lt;update operator&gt; =&gt; { &lt;field1&gt; =&gt; &lt;value1&gt;, ... },<!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;update operator&gt; =&gt; { &lt;field2&gt; =&gt; &lt;value2&gt;, ... },<!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...<!-- --></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-97-menu" aria-describedby="select-97-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-98" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9i:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9i:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9i:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9i:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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"> Some update operators, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , will create the field if the field does not exist. See the individual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operator </a> reference for details. </p> </div> </div> </div> <div> <div aria-labelledby="_98cde7rj4" class="leafygreen-ui-38lglc" id="_7l7k0g93o" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document, MongoDB provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/reference/operator/update/" target="_self"> <span> update operators </span> </a> such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> to modify field values. </p> <p class="leafygreen-ui-1kp3ins"> To use the update operators, pass to the update methods an update document of the form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n &lt;update&gt; =&gt; [ &lt;field1&gt; =&gt; &lt;value1&gt;, ... ],\n &lt;update&gt; =&gt; [ &lt;field2&gt; =&gt; &lt;value2&gt;, ... ],\n ...\n]","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;update operator&gt; =&gt; [ &lt;field1&gt; =&gt; &lt;value1&gt;, ... ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;update operator&gt; =&gt; [ &lt;field2&gt; =&gt; &lt;value2&gt;, ... ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-100-menu" aria-describedby="select-100-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-101" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9j:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9j:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9j:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9j:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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"> Some update operators, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , will create the field if the field does not exist. See the individual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operator </a> reference for details. </p> </div> </div> </div> <div> <div aria-labelledby="_web3ma4sc" class="leafygreen-ui-38lglc" id="_ki23tq1u7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document, MongoDB provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/reference/operator/update/" target="_self"> <span> update operators </span> </a> such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> to modify field values. </p> <p class="leafygreen-ui-1kp3ins"> To use the update operators, pass to the update methods an update document of the form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n &lt;update&gt;: { &lt;field1&gt;: &lt;value1&gt;, ... },\n &lt;update&gt;: { &lt;field2&gt;: &lt;value2&gt;, ... },\n ...\n}","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;update operator&gt;: { &lt;field1&gt;: &lt;value1&gt;, ... },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;update operator&gt;: { &lt;field2&gt;: &lt;value2&gt;, ... },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-103-menu" aria-describedby="select-103-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-104" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9k:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9k:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9k:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9k:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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"> Some update operators, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , will create the field if the field does not exist. See the individual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operator </a> reference for details. </p> </div> </div> </div> <div> <div aria-labelledby="_1sd87zapi" class="leafygreen-ui-38lglc" id="_kcqowrcka" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document, MongoDB provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/reference/operator/update/" target="_self"> <span> update operators </span> </a> such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> to modify field values. </p> <p class="leafygreen-ui-1kp3ins"> To use the update operators, pass to the update methods an update document of the form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n &lt;update&gt; =&gt; { &lt;field1&gt; =&gt; &lt;value1&gt;, ... },\n &lt;update&gt; =&gt; { &lt;field2&gt; =&gt; &lt;value2&gt;, ... },\n ...\n}","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->&lt;update operator&gt; =&gt; { &lt;field1&gt; =&gt; &lt;value1&gt;, ... },<!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;update operator&gt; =&gt; { &lt;field2&gt; =&gt; &lt;value2&gt;, ... },<!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...<!-- --></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-106-menu" aria-describedby="select-106-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-107" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9l:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9l:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9l:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9l:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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"> Some update operators, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , will create the field if the field does not exist. See the individual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operator </a> reference for details. </p> </div> </div> </div> <div> <div aria-labelledby="_y1gdauhm6" class="leafygreen-ui-38lglc" id="_eu4m15rp7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To update a document, MongoDB provides <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/reference/operator/update/" target="_self"> <span> update operators </span> </a> such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> to modify field values. </p> <p class="leafygreen-ui-1kp3ins"> To use the update operators, pass to the update methods an update document of the form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"(\n set (&lt;field1&gt;, &lt;value1&gt;),\n set (&lt;field2&gt;, &lt;value2&gt;),\n ...\n)","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> set (&lt;field1&gt;, &lt;value1&gt;),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> set (&lt;field2&gt;, &lt;value2&gt;),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-109-menu" aria-describedby="select-109-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-110" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9m:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9m:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9m:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9m:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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"> Some update operators, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> , will create the field if the field does not exist. See the individual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operator </a> reference for details. </p> </div> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB can accept an aggregation pipeline to specify the modifications to make instead of an update document. For details, see the method reference page. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-write-op-updateOne"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Update a Single Document <a class="headerlink leafygreen-ui-1kepx47" href="#update-a-single-document" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="update-a-single-document"> </div> </a> </h3> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-9"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_0mum8q6ci" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_sgyouwmhs" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_u56r0vcyq" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_6h8k1h572" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_reb2ixzez" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_phzdi64cd" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_hfjvsqe05" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_uegi47bhd" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_4hqny8wx3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_pvw5o7v15" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_9votqxx6t" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9y4y4o9yy" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_gm6f0eny1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_xw473ac2z" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_ijdf239qe" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_j0s1zzk06" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_ymtzxn46p" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_jlnc2an6h" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_2v51ft0bq" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_22ohyqi81" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_5rktzd3hw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_6skvg90mp" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_bo4z7qzug" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_c47y48zat" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_tkpqgfmhl" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_k2iwx1hqx" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_iv59xl1xj" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ipaj1jmyt" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_bjdva1rb5" class="leafygreen-ui-38lglc" id="_u5ey5jx0d" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#mongodb-method-db.collection.updateOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.updateOne() </code> </a> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update the <em> first </em> document where <code class="leafygreen-ui-1l06pbn"> item </code> equals <code class="leafygreen-ui-1l06pbn"> "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_x2eh5k3sh" class="leafygreen-ui-38lglc" id="_wz90kxnyq" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example demonstrates using <!-- --> MongoDB Compass <!-- --> to modify a single document where <code class="leafygreen-ui-1l06pbn"> item: paper </code> in the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </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"> This example uses the Compass <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/compass/current/documents/view/#std-label-compass-documents-table-view" target="_self"> <span> Table View </span> </a> to modify the document. The editing process using the Compass <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/compass/current/documents/view/#std-label-compass-documents-list-view" target="_self"> <span> List View </span> </a> follows a similar approach. </p> <p class="leafygreen-ui-1kp3ins"> For more information on the differences between Table View and List View in Compass, refer to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/compass/current/documents/view/#std-label-compass-view-documents" target="_self"> <span> Compass documentation <!-- --> . </span> </a> </p> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_kl0mllucm" class="leafygreen-ui-38lglc" id="_9gwhemnpw" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_UpdateOne.htm" rel="noopener noreferrer"> <span> IMongoCollection.UpdateOne() </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update the <em> first </em> document where <code class="leafygreen-ui-1l06pbn"> item </code> equals <code class="leafygreen-ui-1l06pbn"> "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_0rtfrbg6f" class="leafygreen-ui-38lglc" id="_2ypjxf0ov" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://godoc.org/github.com/mongodb/mongo-go-driver/mongo#Collection.UpdateOne" rel="noopener noreferrer"> <span> Collection.UpdateOne </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update the <em> first </em> document where <code class="leafygreen-ui-1l06pbn"> item </code> equals <code class="leafygreen-ui-1l06pbn"> "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_40v8v7c1p" class="leafygreen-ui-38lglc" id="_32k729lcb" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver-reactivestreams/1.6/javadoc/com/mongodb/reactivestreams/client/MongoCollection.html#updateOne(org.bson.conversions.Bson,%20org.bson.conversions.Bson)" rel="noopener noreferrer"> <span> com.mongodb.reactivestreams.client.MongoCollection.updateOne </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> on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update the <em> first </em> document where <code class="leafygreen-ui-1l06pbn"> item </code> equals <code class="leafygreen-ui-1l06pbn"> "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_m38xc94qh" class="leafygreen-ui-38lglc" id="_wfzo2cost" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/MongoCollection.html#updateOne-org.bson.conversions.Bson-org.bson.conversions.Bson-" rel="noopener noreferrer"> <span> com.mongodb.client.MongoCollection.updateOne </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update the <em> first </em> document where <code class="leafygreen-ui-1l06pbn"> item </code> equals <code class="leafygreen-ui-1l06pbn"> "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_7qpt5frqu" class="leafygreen-ui-38lglc" id="_m4tktma2q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-one.html" rel="noopener noreferrer"> <span> MongoCollection.updateOne() </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update the <em> first </em> document where <code class="leafygreen-ui-1l06pbn"> item </code> equals <code class="leafygreen-ui-1l06pbn"> "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_fev70pyab" class="leafygreen-ui-38lglc" id="_hn09tark4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_collection.html#motor.motor_asyncio.AsyncIOMotorCollection.update_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> update_one </code> </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update the <em> first </em> document where <code class="leafygreen-ui-1l06pbn"> item </code> equals <code class="leafygreen-ui-1l06pbn"> "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_odd0ghb3u" class="" id="_j6simr8hp" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#updateOne" rel="noopener noreferrer"> <span> Collection.updateOne() </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update the <em> first </em> document where <code class="leafygreen-ui-1l06pbn"> item </code> equals <code class="leafygreen-ui-1l06pbn"> "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_jozi06qbj" class="leafygreen-ui-38lglc" id="_4f6wvmr6x" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://metacpan.org/pod/MongoDB::Collection#update_one" rel="noopener noreferrer"> <span> update_one() </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update the <em> first </em> document where <code class="leafygreen-ui-1l06pbn"> item </code> equals <code class="leafygreen-ui-1l06pbn"> "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_cv6xk2567" class="leafygreen-ui-38lglc" id="_fv9gt8wr7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/php-library/upcoming/reference/method/MongoDBCollection-updateOne/#mongodb-phpmethod-phpmethod.MongoDB-Collection--updateOne--" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> updateOne() </code> </span> </a> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update the <em> first </em> document where <code class="leafygreen-ui-1l06pbn"> item </code> equals <code class="leafygreen-ui-1l06pbn"> "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_2wy7yn1ol" class="leafygreen-ui-38lglc" id="_dgn21t8ak" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.update_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> update_one </code> </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update the <em> first </em> document where <code class="leafygreen-ui-1l06pbn"> item </code> equals <code class="leafygreen-ui-1l06pbn"> "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_8mnjzcci2" class="leafygreen-ui-38lglc" id="_kgj7ylhxv" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://api.mongodb.com/ruby/current/Mongo/Collection.html#update_one-instance_method" target="_self"> <span> update_one() </span> </a> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update the <em> first </em> document where <code class="leafygreen-ui-1l06pbn"> item </code> equals <code class="leafygreen-ui-1l06pbn"> "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_1vr82idak" class="leafygreen-ui-38lglc" id="_dvizphz02" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-scala-driver/2.9/scaladoc/org/mongodb/scala/MongoCollection.html#updateOne(filter:org.mongodb.scala.bson.conversions.Bson,update:org.mongodb.scala.bson.conversions.Bson,options:org.mongodb.scala.model.UpdateOptions):org.mongodb.scala.SingleObservable[org.mongodb.scala.result.UpdateResult]" rel="noopener noreferrer"> <span> updateOne() </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update the <em> first </em> document where <code class="leafygreen-ui-1l06pbn"> item </code> equals <code class="leafygreen-ui-1l06pbn"> "paper" </code> : </p> </div> </div> </div> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-10"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_tsmak53aq" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_cbef251qi" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_9a2kzd2mu" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_se97uw9zj" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_ld9k283yc" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5k9kh9fen" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_dulhjy8qp" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_vmi3zrq3o" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_vqvcs6icb" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fv7ni1j3d" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_ubshrnqao" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_slvf2czxl" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_o6mqclckt" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_bomctct6h" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_z45dy4oa6" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_a1je8ui2k" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_mwphabox9" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_jftvhgb2z" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_g4yd8al8t" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_pcjsztlz3" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_ssvtgqvyi" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_v9m4bfrov" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_utmu9h8k5" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_3jvgen8p8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_xbhb4086x" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_t3v1hx466" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_k9l96zo1t" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_f41v04ad8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_l4jrp6u0g" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_esq99k65y" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_77nhf6pgl" class="leafygreen-ui-38lglc" id="_asyelxabi" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.updateOne(\n { item: \"paper\" },\n {\n $set: { \"size.uom\": \"cm\", status: \"P\" },\n $currentDate: { lastModified: true }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"paper"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$set</span>: <!-- -->{ <span class="lg-highlight-string">"size.uom"</span>: <span class="lg-highlight-string">"cm"</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"P"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$currentDate</span>: <!-- -->{ <span class="lg-highlight-attr">lastModified</span>: <span class="lg-highlight-literal">true</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-112-menu" aria-describedby="select-112-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-113" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9n:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9n:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9n:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9n:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "cm" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_p50iagw8s" class="leafygreen-ui-38lglc" id="_qpfe2bthr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> Modify the target document as follows: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Change the <code class="leafygreen-ui-1l06pbn"> status </code> field from <code class="leafygreen-ui-1l06pbn"> D </code> to <code class="leafygreen-ui-1l06pbn"> P </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Change the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field from <code class="leafygreen-ui-1l06pbn"> in </code> to <code class="leafygreen-ui-1l06pbn"> cm </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Add a new field called <code class="leafygreen-ui-1l06pbn"> lastModified </code> whose value will be today's date. </p> </li> </ul> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click the <span class="guilabel css-h15tq0"> Table </span> button in the top navigation to access the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/compass/current/documents/view/#std-label-compass-documents-table-view" target="_self"> <span> Table View <!-- --> : </span> </a> </p> <div class="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:1500px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='578'%20width='1500'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Access Table View" data-main-image="" decoding="async" height="578" loading="lazy" sizes="(min-width: 1500px) 1500px, 100vw" src="/docs/manual/static/32b3f2f6d72e5d64e2ebea923b7bcf04/8650f/compass-table-btn-click.webp" srcset="/docs/manual/static/32b3f2f6d72e5d64e2ebea923b7bcf04/1ab38/compass-table-btn-click.webp 375w,/docs/manual/static/32b3f2f6d72e5d64e2ebea923b7bcf04/b2313/compass-table-btn-click.webp 750w,/docs/manual/static/32b3f2f6d72e5d64e2ebea923b7bcf04/8650f/compass-table-btn-click.webp 1500w" style="--border-color:#C1C7C6;opacity:0" width="1500"/> <noscript> <img alt="Access Table View" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="578" loading="lazy" sizes="(min-width: 1500px) 1500px, 100vw" src="/docs/manual/static/32b3f2f6d72e5d64e2ebea923b7bcf04/8650f/compass-table-btn-click.webp" srcset="/docs/manual/static/32b3f2f6d72e5d64e2ebea923b7bcf04/1ab38/compass-table-btn-click.webp 375w,/docs/manual/static/32b3f2f6d72e5d64e2ebea923b7bcf04/b2313/compass-table-btn-click.webp 750w,/docs/manual/static/32b3f2f6d72e5d64e2ebea923b7bcf04/8650f/compass-table-btn-click.webp 1500w" style="--border-color:#C1C7C6;opacity:0" width="1500"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use the Compass <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/compass/current/query/filter/#std-label-compass-query-bar-filter" target="_self"> <span> query bar </span> </a> to locate the target document. </p> <p class="leafygreen-ui-1kp3ins"> Copy the following filter document into the query bar and click <span class="guilabel css-h15tq0"> Find </span> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ item: \"paper\" }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"paper"</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-115-menu" aria-describedby="select-115-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-116" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9o:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9o:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9o:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9o:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:1502px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='530'%20width='1502'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Find Paper document" data-main-image="" decoding="async" height="530" loading="lazy" sizes="(min-width: 1502px) 1502px, 100vw" src="/docs/manual/static/6e2185e0647fe28c8afd03f9ceaa4495/452dd/compass-update-paper-filter.webp" srcset="/docs/manual/static/6e2185e0647fe28c8afd03f9ceaa4495/30637/compass-update-paper-filter.webp 376w,/docs/manual/static/6e2185e0647fe28c8afd03f9ceaa4495/ebe50/compass-update-paper-filter.webp 751w,/docs/manual/static/6e2185e0647fe28c8afd03f9ceaa4495/452dd/compass-update-paper-filter.webp 1502w" style="--border-color:#C1C7C6;opacity:0" width="1502"/> <noscript> <img alt="Find Paper document" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="530" loading="lazy" sizes="(min-width: 1502px) 1502px, 100vw" src="/docs/manual/static/6e2185e0647fe28c8afd03f9ceaa4495/452dd/compass-update-paper-filter.webp" srcset="/docs/manual/static/6e2185e0647fe28c8afd03f9ceaa4495/30637/compass-update-paper-filter.webp 376w,/docs/manual/static/6e2185e0647fe28c8afd03f9ceaa4495/ebe50/compass-update-paper-filter.webp 751w,/docs/manual/static/6e2185e0647fe28c8afd03f9ceaa4495/452dd/compass-update-paper-filter.webp 1502w" style="--border-color:#C1C7C6;opacity:0" width="1502"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Hover over the <code class="leafygreen-ui-1l06pbn"> status </code> field and click the pencil icon which appears on the right side of the document to enter edit mode: </p> <div class="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:1502px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='596'%20width='1502'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Click edit button" data-main-image="" decoding="async" height="596" loading="lazy" sizes="(min-width: 1502px) 1502px, 100vw" src="/docs/manual/static/0f436d1524d7ac953544baddb53465c1/c3f46/compass-edit-paper-example.webp" srcset="/docs/manual/static/0f436d1524d7ac953544baddb53465c1/001dd/compass-edit-paper-example.webp 376w,/docs/manual/static/0f436d1524d7ac953544baddb53465c1/8b84f/compass-edit-paper-example.webp 751w,/docs/manual/static/0f436d1524d7ac953544baddb53465c1/c3f46/compass-edit-paper-example.webp 1502w" style="--border-color:#C1C7C6;opacity:0" width="1502"/> <noscript> <img alt="Click edit button" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="596" loading="lazy" sizes="(min-width: 1502px) 1502px, 100vw" src="/docs/manual/static/0f436d1524d7ac953544baddb53465c1/c3f46/compass-edit-paper-example.webp" srcset="/docs/manual/static/0f436d1524d7ac953544baddb53465c1/001dd/compass-edit-paper-example.webp 376w,/docs/manual/static/0f436d1524d7ac953544baddb53465c1/8b84f/compass-edit-paper-example.webp 751w,/docs/manual/static/0f436d1524d7ac953544baddb53465c1/c3f46/compass-edit-paper-example.webp 1502w" style="--border-color:#C1C7C6;opacity:0" width="1502"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Change the value of the field to <code class="leafygreen-ui-1l06pbn"> "P" </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click the <span class="guilabel css-h15tq0"> Update </span> button below the field to save your changes. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Hover over the <code class="leafygreen-ui-1l06pbn"> size </code> field and click the outward-pointing arrows which appear on the right side of the field. This opens a new tab which displays the fields within the <code class="leafygreen-ui-1l06pbn"> size </code> object: </p> <div class="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:1502px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='548'%20width='1502'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Expand size object" data-main-image="" decoding="async" height="548" loading="lazy" sizes="(min-width: 1502px) 1502px, 100vw" src="/docs/manual/static/50c7524a62543c46e2980fa136791649/d532c/compass-edit-paper-expand.webp" srcset="/docs/manual/static/50c7524a62543c46e2980fa136791649/b76c9/compass-edit-paper-expand.webp 376w,/docs/manual/static/50c7524a62543c46e2980fa136791649/bdfc1/compass-edit-paper-expand.webp 751w,/docs/manual/static/50c7524a62543c46e2980fa136791649/d532c/compass-edit-paper-expand.webp 1502w" style="--border-color:#C1C7C6;opacity:0" width="1502"/> <noscript> <img alt="Expand size object" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="548" loading="lazy" sizes="(min-width: 1502px) 1502px, 100vw" src="/docs/manual/static/50c7524a62543c46e2980fa136791649/d532c/compass-edit-paper-expand.webp" srcset="/docs/manual/static/50c7524a62543c46e2980fa136791649/b76c9/compass-edit-paper-expand.webp 376w,/docs/manual/static/50c7524a62543c46e2980fa136791649/bdfc1/compass-edit-paper-expand.webp 751w,/docs/manual/static/50c7524a62543c46e2980fa136791649/d532c/compass-edit-paper-expand.webp 1502w" style="--border-color:#C1C7C6;opacity:0" width="1502"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Using the same process outlined in steps 3-5 for editing the <code class="leafygreen-ui-1l06pbn"> status </code> field, change the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "cm" </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click the left-most tab above the table labelled <code class="leafygreen-ui-1l06pbn"> inventory </code> to return to the original table view, which displays the top-level document: </p> <div class="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:1504px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='530'%20width='1504'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Click inventory tab" data-main-image="" decoding="async" height="530" loading="lazy" sizes="(min-width: 1504px) 1504px, 100vw" src="/docs/manual/static/86efc30ba8133a13006ca84b63298c9e/e6081/compass-edit-inv-tab-click.webp" srcset="/docs/manual/static/86efc30ba8133a13006ca84b63298c9e/30637/compass-edit-inv-tab-click.webp 376w,/docs/manual/static/86efc30ba8133a13006ca84b63298c9e/6ed98/compass-edit-inv-tab-click.webp 752w,/docs/manual/static/86efc30ba8133a13006ca84b63298c9e/e6081/compass-edit-inv-tab-click.webp 1504w" style="--border-color:#C1C7C6;opacity:0" width="1504"/> <noscript> <img alt="Click inventory tab" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="530" loading="lazy" sizes="(min-width: 1504px) 1504px, 100vw" src="/docs/manual/static/86efc30ba8133a13006ca84b63298c9e/e6081/compass-edit-inv-tab-click.webp" srcset="/docs/manual/static/86efc30ba8133a13006ca84b63298c9e/30637/compass-edit-inv-tab-click.webp 376w,/docs/manual/static/86efc30ba8133a13006ca84b63298c9e/6ed98/compass-edit-inv-tab-click.webp 752w,/docs/manual/static/86efc30ba8133a13006ca84b63298c9e/e6081/compass-edit-inv-tab-click.webp 1504w" style="--border-color:#C1C7C6;opacity:0" width="1504"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Hover over the <code class="leafygreen-ui-1l06pbn"> status </code> field and click the pencil icon which appears on the right side of the document to re-enter edit mode. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click inside of the <code class="leafygreen-ui-1l06pbn"> status </code> field and click the <span class="guilabel css-h15tq0"> plus button </span> icon which appears in the edit menu. </p> <p class="leafygreen-ui-1kp3ins"> Click the <span class="guilabel css-h15tq0"> Add Field After status </span> button which appears below the plus button: </p> <div class="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:1500px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='592'%20width='1500'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Add field after status" data-main-image="" decoding="async" height="592" loading="lazy" sizes="(min-width: 1500px) 1500px, 100vw" src="/docs/manual/static/303446d54373f45552b6d6c4808bf614/9ea0d/compass-edit-paper-add-field-after.webp" srcset="/docs/manual/static/303446d54373f45552b6d6c4808bf614/caf94/compass-edit-paper-add-field-after.webp 375w,/docs/manual/static/303446d54373f45552b6d6c4808bf614/ba84b/compass-edit-paper-add-field-after.webp 750w,/docs/manual/static/303446d54373f45552b6d6c4808bf614/9ea0d/compass-edit-paper-add-field-after.webp 1500w" style="--border-color:#C1C7C6;opacity:0" width="1500"/> <noscript> <img alt="Add field after status" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="592" loading="lazy" sizes="(min-width: 1500px) 1500px, 100vw" src="/docs/manual/static/303446d54373f45552b6d6c4808bf614/9ea0d/compass-edit-paper-add-field-after.webp" srcset="/docs/manual/static/303446d54373f45552b6d6c4808bf614/caf94/compass-edit-paper-add-field-after.webp 375w,/docs/manual/static/303446d54373f45552b6d6c4808bf614/ba84b/compass-edit-paper-add-field-after.webp 750w,/docs/manual/static/303446d54373f45552b6d6c4808bf614/9ea0d/compass-edit-paper-add-field-after.webp 1500w" style="--border-color:#C1C7C6;opacity:0" width="1500"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Add a new field called <code class="leafygreen-ui-1l06pbn"> lastModified </code> with a value of today's date. Set the field type to <code class="leafygreen-ui-1l06pbn"> Date </code> : </p> <div class="figure css-5vkxs0" style="width:auto"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:1500px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='262'%20width='1500'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Submit update" data-main-image="" decoding="async" height="262" loading="lazy" sizes="(min-width: 1500px) 1500px, 100vw" src="/docs/manual/static/19fcd4d1ce2be829a3e66688416e06f3/6397b/compass-edit-paper-add-last-modified.webp" srcset="/docs/manual/static/19fcd4d1ce2be829a3e66688416e06f3/9540b/compass-edit-paper-add-last-modified.webp 375w,/docs/manual/static/19fcd4d1ce2be829a3e66688416e06f3/3acc7/compass-edit-paper-add-last-modified.webp 750w,/docs/manual/static/19fcd4d1ce2be829a3e66688416e06f3/6397b/compass-edit-paper-add-last-modified.webp 1500w" style="--border-color:#C1C7C6;opacity:0" width="1500"/> <noscript> <img alt="Submit update" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="262" loading="lazy" sizes="(min-width: 1500px) 1500px, 100vw" src="/docs/manual/static/19fcd4d1ce2be829a3e66688416e06f3/6397b/compass-edit-paper-add-last-modified.webp" srcset="/docs/manual/static/19fcd4d1ce2be829a3e66688416e06f3/9540b/compass-edit-paper-add-last-modified.webp 375w,/docs/manual/static/19fcd4d1ce2be829a3e66688416e06f3/3acc7/compass-edit-paper-add-last-modified.webp 750w,/docs/manual/static/19fcd4d1ce2be829a3e66688416e06f3/6397b/compass-edit-paper-add-last-modified.webp 1500w" style="--border-color:#C1C7C6;opacity:0" width="1500"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click the <span class="guilabel css-h15tq0"> Update </span> button below the field to save your changes. </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"> Because <!-- --> MongoDB Compass <!-- --> does not support <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> or any other <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update-field/#std-label-field-update-operators"> Field Update Operators </a> , you must manually enter the date value in Compass. </p> </div> </div> </li> </ol> </div> </div> </div> <div> <div aria-labelledby="_l6q242plc" class="leafygreen-ui-38lglc" id="_tvymzs560" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongoc_collection_t *collection;\nbson_t *selector;\nbson_t *update;\nbool r;\nbson_error_t error;\n\ncollection = mongoc_database_get_collection (db, \"inventory\");\nselector = BCON_NEW (\"item\", BCON_UTF8 (\"paper\"));\nupdate = BCON_NEW (\n \"$set\", \"{\",\n \"size.uom\", BCON_UTF8 (\"cm\"),\n \"status\", BCON_UTF8 (\"P\"),\n \"}\",\n \"$currentDate\", \"{\",\n \"lastModified\", BCON_BOOL (true),\n \"}\");\n\nr = mongoc_collection_update_one(collection, selector, update, NULL, NULL, &amp;error);\nbson_destroy (selector);\nbson_destroy (update);\n\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongoc_collection_t *collection;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *selector;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *update;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bool r;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_error_t error;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection <!-- -->= <!-- -->mongoc_database_get_collection (db<!-- -->, <span class="lg-highlight-string">"inventory"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">selector <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (<!-- --><!-- --><span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> <!-- -->(<span class="lg-highlight-string">"paper"</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx">update <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$set"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size.uom"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"cm"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"P"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$currentDate"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"lastModified"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_BOOL</span> (<!-- --><span class="lg-highlight-literal">true</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- --><span class="lg-highlight-title lg-highlight-function">mongoc_collection_update_one</span>(collection, selector<!-- -->, update, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->selector);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->update);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-118-menu" aria-describedby="select-118-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-119" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9p:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9p:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9p:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9p:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_syy6ai42e" class="leafygreen-ui-38lglc" id="_zmchyiy67" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var filter = Builders&lt;bsondocument&gt;.Filter.Eq(\"item\", \"paper\");\nvar update = Builders&lt;bsondocument&gt;.Update.Set(\"size.uom\", \"cm\").Set(\"status\", \"P\").CurrentDate(\"lastModified\");\nvar result = collection.UpdateOne(filter, update);","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> filter = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>.<span class="lg-highlight-title lg-highlight-class">Eq</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> update = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Update</span>.<span class="lg-highlight-title lg-highlight-class">Set</span>(<span class="lg-highlight-string">"size.uom"</span>, <span class="lg-highlight-string">"cm"</span>).<span class="lg-highlight-title lg-highlight-class">Set</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>).<span class="lg-highlight-title lg-highlight-class">CurrentDate</span>(<span class="lg-highlight-string">"lastModified"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> result = collection.<span class="lg-highlight-title lg-highlight-class">UpdateOne</span>(filter, update);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-121-menu" aria-describedby="select-121-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-122" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9q:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9q:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9q:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9q:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "cm" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_yb6mmyaun" class="leafygreen-ui-38lglc" id="_9an1u5ey2" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\nresult, err := coll.UpdateOne(\n\tcontext.TODO(),\n\tbson.D{\n\t\t{\"item\", \"paper\"},\n\t},\n\tbson.D{\n\t\t{\"$set\", bson.D{\n\t\t\t{\"size.uom\", \"cm\"},\n\t\t\t{\"status\", \"P\"},\n\t\t}},\n\t\t{\"$currentDate\", bson.D{\n\t\t\t{\"lastModified\", true},\n\t\t}},\n\t},\n)\n","programmingLanguage":"Golang"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">result<!-- -->, <!-- -->err := coll.<span class="lg-highlight-title lg-highlight-class">UpdateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> context.<span class="lg-highlight-title lg-highlight-function">TODO</span>(),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$set"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"size.uom"</span>, <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$currentDate"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"lastModified"</span>, <span class="lg-highlight-literal">true</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-124-menu" aria-describedby="select-124-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-125" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9r:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9r:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9r:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9r:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "cm" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_3gmp7dz8y" class="leafygreen-ui-38lglc" id="_8vjxsubgw" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"Publisher&lt;updateresult&gt; updateOnePublisher = collection.updateOne(eq(\"item\", \"paper\"),\n combine(set(\"size.uom\", \"cm\"), set(\"status\", \"P\"), currentDate(\"lastModified\")));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">Publisher</span>&lt;<span class="lg-highlight-title lg-highlight-class">UpdateResult</span>&gt; updateOnePublisher = collection.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(<span class="lg-highlight-title lg-highlight-function">eq</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-function">combine</span>(<span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"size.uom"</span>, <span class="lg-highlight-string">"cm"</span>), <span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>), <span class="lg-highlight-title lg-highlight-function">currentDate</span>(<span class="lg-highlight-string">"lastModified"</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-127-menu" aria-describedby="select-127-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-128" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9s:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9s:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9s:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9s:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "cm" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_csi1v7brd" class="leafygreen-ui-38lglc" id="_86i4qmza3" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.updateOne(eq(\"item\", \"paper\"),\n combine(set(\"size.uom\", \"cm\"), set(\"status\", \"P\"), currentDate(\"lastModified\")));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(<span class="lg-highlight-title lg-highlight-function">eq</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-function">combine</span>(<span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"size.uom"</span>, <span class="lg-highlight-string">"cm"</span>), <span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>), <span class="lg-highlight-title lg-highlight-function">currentDate</span>(<span class="lg-highlight-string">"lastModified"</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-130-menu" aria-describedby="select-130-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-131" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9t:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9t:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9t:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9t:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "cm" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_pi4g8npvv" class="leafygreen-ui-38lglc" id="_2ulh6jv78" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.updateOne(eq(\"item\", \"paper\"),\n combine(set(\"size.uom\", \"cm\"), set(\"status\", \"P\"), currentDate(\"lastModified\")));","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(<span class="lg-highlight-title lg-highlight-function">eq</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-function">combine</span>(<span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"size.uom"</span>, <span class="lg-highlight-string">"cm"</span>), <span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>), <span class="lg-highlight-title lg-highlight-function">currentDate</span>(<span class="lg-highlight-string">"lastModified"</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-133-menu" aria-describedby="select-133-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-134" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9u:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9u:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9u:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9u:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "cm" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_s9fkua0m6" class="leafygreen-ui-38lglc" id="_nflumpxzm" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"await db.inventory.update_one(\n {\"item\": \"paper\"},\n {\"$set\": {\"size.uom\": \"cm\", \"status\": \"P\"}, \"$currentDate\": {\"lastModified\": True}},\n)","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">await</span> db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">update_one</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"paper"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$set"</span>: {<span class="lg-highlight-string">"size.uom"</span>: <span class="lg-highlight-string">"cm"</span>, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"P"</span>}, <span class="lg-highlight-string">"$currentDate"</span>: {<span class="lg-highlight-string">"lastModified"</span>: <span class="lg-highlight-title lg-highlight-class">True</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-136-menu" aria-describedby="select-136-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-137" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r9v:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r9v:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9v:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r9v:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "cm" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_rrurnr4t6" class="" id="_il9bx1qgh" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"await db.collection('inventory').updateOne(\n { item: 'paper' },\n {\n $set: { 'size.uom': 'cm', status: 'P' },\n $currentDate: { lastModified: true }\n }\n);","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">await</span> db.<span class="lg-highlight-title lg-highlight-function">collection</span>(<span class="lg-highlight-string">'inventory'</span>).<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'paper'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$set</span>: <!-- -->{ <span class="lg-highlight-string">'size.uom'</span>: <span class="lg-highlight-string">'cm'</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'P'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$currentDate</span>: <!-- -->{ <span class="lg-highlight-attr">lastModified</span>: <span class="lg-highlight-literal">true</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-139-menu" aria-describedby="select-139-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-140" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ra0:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ra0:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra0:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra0:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "cm" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_wmn1l0zoj" class="leafygreen-ui-38lglc" id="_amiw89jnv" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"# For boolean values, use boolean.pm for 'true' and 'false'\n$db-&gt;coll(\"inventory\")-&gt;update_one(\n { item =&gt; \"paper\" },\n {\n '$set' =&gt; { \"size.uom\" =&gt; \"cm\", status =&gt; \"P\" },\n '$currentDate' =&gt; { lastModified =&gt; true }\n }\n);","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"># <span class="lg-highlight-title lg-highlight-class">For</span> boolean values, use boolean.<span class="lg-highlight-property">pm</span> <span class="lg-highlight-keyword">for</span> <span class="lg-highlight-string">'true'</span> and <span class="lg-highlight-string">'false'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">$db<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">coll</span>(<span class="lg-highlight-string">"inventory"</span>)<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">update_one</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-params lg-highlight-function">item</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"paper"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$set'</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-string">"size.uom"</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-string">"cm"</span>, <span class="lg-highlight-params lg-highlight-function">status</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"P"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$currentDate'</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-params lg-highlight-function">lastModified</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-literal">true</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-142-menu" aria-describedby="select-142-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-143" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ra1:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ra1:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra1:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra1:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "cm" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_3p73xwzvi" class="leafygreen-ui-38lglc" id="_tz5d1kaoj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$updateResult = $db-&gt;inventory-&gt;updateOne(\n ['item' =&gt; 'paper'],\n [\n '$set' =&gt; ['size.uom' =&gt; 'cm', 'status' =&gt; 'P'],\n '$currentDate' =&gt; ['lastModified' =&gt; true],\n ],\n);","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$updateResult = $db-&gt;inventory-&gt;<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [<span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'paper'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$set'</span> =&gt; [<span class="lg-highlight-string">'size.uom'</span> =&gt; <span class="lg-highlight-string">'cm'</span>, <span class="lg-highlight-string">'status'</span> =&gt; <span class="lg-highlight-string">'P'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$currentDate'</span> =&gt; [<span class="lg-highlight-string">'lastModified'</span> =&gt; <span class="lg-highlight-literal">true</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-145-menu" aria-describedby="select-145-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-146" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ra2:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ra2:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra2:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra2:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "cm" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_69fwib6um" class="leafygreen-ui-38lglc" id="_98eegavn9" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.update_one(\n {\"item\": \"paper\"},\n {\"$set\": {\"size.uom\": \"cm\", \"status\": \"P\"}, \"$currentDate\": {\"lastModified\": True}},\n)","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">update_one</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"paper"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$set"</span>: {<span class="lg-highlight-string">"size.uom"</span>: <span class="lg-highlight-string">"cm"</span>, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"P"</span>}, <span class="lg-highlight-string">"$currentDate"</span>: {<span class="lg-highlight-string">"lastModified"</span>: <span class="lg-highlight-title lg-highlight-class">True</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-148-menu" aria-describedby="select-148-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-149" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ra3:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ra3:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra3:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra3:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_e8l1bodkv" class="leafygreen-ui-38lglc" id="_ulwxylab6" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client[:inventory].update_one({ item: 'paper'},\n { '$set' =&gt; { 'size.uom' =&gt; 'cm', 'status' =&gt; 'P' },\n '$currentDate' =&gt; { 'lastModified' =&gt; true } })","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client<!-- -->[<!-- -->:inventory].<span class="lg-highlight-title lg-highlight-function">update_one</span>(<!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'paper'</span>}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">'$set'</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-string">'size.uom'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-string">'cm'</span>, <span class="lg-highlight-string">'status'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-string">'P'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$currentDate'</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-string">'lastModified'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-literal">true</span> } })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-151-menu" aria-describedby="select-151-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-152" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ra4:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ra4:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra4:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra4:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "cm" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_vcdmp8qdl" class="leafygreen-ui-38lglc" id="_g81i3e6bg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.updateOne(equal(\"item\", \"paper\"),\n combine(set(\"size.uom\", \"cm\"), set(\"status\", \"P\"), currentDate(\"lastModified\"))\n).execute()","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(<span class="lg-highlight-title lg-highlight-function">equal</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-function">combine</span>(<span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"size.uom"</span>, <span class="lg-highlight-string">"cm"</span>), <span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>), <span class="lg-highlight-title lg-highlight-function">currentDate</span>(<span class="lg-highlight-string">"lastModified"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx">).<span class="lg-highlight-title lg-highlight-function">execute</span>()</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-154-menu" aria-describedby="select-154-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-155" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ra5:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ra5:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra5:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra5:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "cm" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-update-multiple-documents"> </span> <span class="leafygreen-ui-1qnjd6d" id="std-label-write-op-updateMany"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Update Multiple Documents <a class="headerlink leafygreen-ui-1kepx47" href="#update-multiple-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="update-multiple-documents"> </div> </a> </h3> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-12"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_s72q4mhte" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0vz39u5xr" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_yyqjipyub" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_vsjsjeit4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_sr63qf3r7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_x5ef8n6i7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_a95hwbtnj" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ihw9o149u" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_lutcj9jok" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_a2aeel40v" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_24l2bhftf" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fms6rpgcz" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_ce9uov1g6" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_vhde2pics" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_ohfsf2ao6" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0mxr9pcla" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_0os80m8uc" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_uyk9ldv7g" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_hsmseb3ky" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ipr1hfrdo" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_6ti8bkr6c" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_zakwzvrzs" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_dahu1jxvy" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_eupfta74r" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_mvb2t89iu" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_kp9q6l008" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_fgdzehtmz" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_rukoc70h1" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_zmsphx3ez" class="leafygreen-ui-38lglc" id="_5vjo4csuz" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateMany/#mongodb-method-db.collection.updateMany"> <code class="leafygreen-ui-1l06pbn"> db.collection.updateMany() </code> </a> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update all documents where <code class="leafygreen-ui-1l06pbn"> qty </code> is less than <code class="leafygreen-ui-1l06pbn"> 50 </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_rrah9siez" class="leafygreen-ui-38lglc" id="_z6niipzx2" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> You can update only one document at a time in <!-- --> MongoDB Compass <!-- --> . To update multiple documents, connect to your MongoDB deployment from <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> or a MongoDB driver and follow the examples in this section for your preferred method. </p> </div> </div> </div> <div> <div aria-labelledby="_55psykin4" class="leafygreen-ui-38lglc" id="_6vm1ip0xb" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_UpdateMany.htm" rel="noopener noreferrer"> <span> IMongoCollection.UpdateMany() </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update all documents where <code class="leafygreen-ui-1l06pbn"> qty </code> is less than <code class="leafygreen-ui-1l06pbn"> 50 </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_80tpyc9m4" class="leafygreen-ui-38lglc" id="_fkztclz1d" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://godoc.org/github.com/mongodb/mongo-go-driver/mongo#Collection.UpdateMany" rel="noopener noreferrer"> <span> Collection.UpdateMany </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update all documents where <code class="leafygreen-ui-1l06pbn"> qty </code> is less than <code class="leafygreen-ui-1l06pbn"> 50 </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_bl7ahyw56" class="leafygreen-ui-38lglc" id="_dyqtq3gno" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver-reactivestreams/1.6/javadoc/com/mongodb/reactivestreams/client/MongoCollection.html#updateMany(org.bson.conversions.Bson,%20org.bson.conversions.Bson)" rel="noopener noreferrer"> <span> com.mongodb.reactivestreams.client.MongoCollection.updateMany </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update all documents where <code class="leafygreen-ui-1l06pbn"> qty </code> is less than <code class="leafygreen-ui-1l06pbn"> 50 </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_dqc9sthet" class="leafygreen-ui-38lglc" id="_263jk71rb" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/MongoCollection.html#updateMany-org.bson.conversions.Bson-org.bson.conversions.Bson-" rel="noopener noreferrer"> <span> com.mongodb.client.MongoCollection.updateMany </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update all documents where <code class="leafygreen-ui-1l06pbn"> qty </code> is less than <code class="leafygreen-ui-1l06pbn"> 50 </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_agnb91y0p" class="leafygreen-ui-38lglc" id="_kl5iyp2v3" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-many.html" rel="noopener noreferrer"> <span> MongoCollection.updateMany() </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update all documents where <code class="leafygreen-ui-1l06pbn"> qty </code> is less than <code class="leafygreen-ui-1l06pbn"> 50 </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_y7i1w16cc" class="leafygreen-ui-38lglc" id="_6xypiimk1" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_collection.html#motor.motor_asyncio.AsyncIOMotorCollection.update_many" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> update_many </code> </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update all documents where <code class="leafygreen-ui-1l06pbn"> qty </code> is less than <code class="leafygreen-ui-1l06pbn"> 50 </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_bt8rrvdby" class="" id="_0s8klu5w8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#updateMany" rel="noopener noreferrer"> <span> Collection.updateMany() </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update all documents where <code class="leafygreen-ui-1l06pbn"> qty </code> is less than <code class="leafygreen-ui-1l06pbn"> 50 </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_ykjv2a483" class="leafygreen-ui-38lglc" id="_jitnaa7oa" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://metacpan.org/pod/MongoDB::Collection#update_many" rel="noopener noreferrer"> <span> update_many() </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update all documents where <code class="leafygreen-ui-1l06pbn"> qty </code> is less than <code class="leafygreen-ui-1l06pbn"> 50 </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_vs1exid5e" class="leafygreen-ui-38lglc" id="_4bnon64nu" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/php-library/upcoming/reference/method/MongoDBCollection-updateMany/#mongodb-phpmethod-phpmethod.MongoDB-Collection--updateMany--" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> updateMany() </code> </span> </a> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update all documents where <code class="leafygreen-ui-1l06pbn"> qty </code> is less than <code class="leafygreen-ui-1l06pbn"> 50 </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_wwh7l09pa" class="leafygreen-ui-38lglc" id="_ei94kzebc" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.update_many" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> update_many </code> </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update all documents where <code class="leafygreen-ui-1l06pbn"> qty </code> is less than <code class="leafygreen-ui-1l06pbn"> 50 </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_ujqoopp68" class="leafygreen-ui-38lglc" id="_7gb6gh2bx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://api.mongodb.com/ruby/current/Mongo/Collection.html#update_many-instance_method" target="_self"> <span> update_many() </span> </a> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update all documents where <code class="leafygreen-ui-1l06pbn"> qty </code> is less than <code class="leafygreen-ui-1l06pbn"> 50 </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_r2okwqd9y" class="leafygreen-ui-38lglc" id="_oywm4sn3x" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-scala-driver/2.9/scaladoc/org/mongodb/scala/MongoCollection.html#updateMany(filter:org.mongodb.scala.bson.conversions.Bson,update:org.mongodb.scala.bson.conversions.Bson,options:org.mongodb.scala.model.UpdateOptions):org.mongodb.scala.SingleObservable[org.mongodb.scala.result.UpdateResult]" rel="noopener noreferrer"> <span> updateMany() </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> method on the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection to update all documents where <code class="leafygreen-ui-1l06pbn"> qty </code> is less than <code class="leafygreen-ui-1l06pbn"> 50 </code> : </p> </div> </div> </div> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-13"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_bjyrpn54d" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_bpu5kuu3h" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_qaql9iuhv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_nbgdpl4zo" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_kjk0xczam" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_rm0gezhl6" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_1zidcxmu6" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_930i8c4ik" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_nfgxrqpo4" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tuts62dti" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_0vwh62xsh" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_21o204jo0" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_aup3h8szv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0tygkaii8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_2hqlg0ayh" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_05vj73dwp" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_6x5uajzy1" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_m6xljjtac" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_hefnjram5" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_g4hq3wg1f" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_cu1lli7xl" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_z1376q89w" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_ilgtwpat3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_b28e293gk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_2xybmtvxv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_m41j8btem" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_npzvcrw4z" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5mxa0ltwa" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_3j6j9sxhk" class="leafygreen-ui-38lglc" id="_7zghanp5q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.updateMany(\n { \"qty\": { $lt: 50 } },\n {\n $set: { \"size.uom\": \"in\", status: \"P\" },\n $currentDate: { lastModified: true }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">updateMany</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"qty"</span>: <!-- -->{ <span class="lg-highlight-attr">$lt</span>: <span class="lg-highlight-number">50</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$set</span>: <!-- -->{ <span class="lg-highlight-string">"size.uom"</span>: <span class="lg-highlight-string">"in"</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"P"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$currentDate</span>: <!-- -->{ <span class="lg-highlight-attr">lastModified</span>: <span class="lg-highlight-literal">true</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-157-menu" aria-describedby="select-157-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-158" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ra6:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ra6:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra6:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra6:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "in" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_himmm428g" class="leafygreen-ui-38lglc" id="_47i2v5jj8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongoc_collection_t *collection;\nbson_t *selector;\nbson_t *update;\nbool r;\nbson_error_t error;\n\ncollection = mongoc_database_get_collection (db, \"inventory\");\nselector = BCON_NEW (\n \"qty\", \"{\",\n \"$lt\", BCON_INT64 (50),\n \"}\");\nupdate = BCON_NEW (\n \"$set\", \"{\",\n \"size.uom\", BCON_UTF8 (\"in\"),\n \"status\", BCON_UTF8 (\"P\"),\n \"}\",\n \"$currentDate\", \"{\",\n \"lastModified\", BCON_BOOL (true),\n \"}\");\n\nr = mongoc_collection_update_many(collection, selector, update, NULL, NULL, &amp;error);\nbson_destroy (selector);\nbson_destroy (update);\n\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongoc_collection_t *collection;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *selector;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *update;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bool r;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_error_t error;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection <!-- -->= <!-- -->mongoc_database_get_collection (db<!-- -->, <span class="lg-highlight-string">"inventory"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">selector <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$lt"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">50</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">update <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$set"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"size.uom"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"in"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"status"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"P"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$currentDate"</span>, <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"lastModified"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_BOOL</span> (<!-- --><span class="lg-highlight-literal">true</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- --><span class="lg-highlight-title lg-highlight-function">mongoc_collection_update_many</span>(collection, selector<!-- -->, update, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->selector);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->update);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-160-menu" aria-describedby="select-160-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-161" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ra7:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ra7:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra7:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra7:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_gl9x2fe7l" class="leafygreen-ui-38lglc" id="_czn89jsgq" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var filter = Builders&lt;bsondocument&gt;.Filter.Lt(\"qty\", 50);\nvar update = Builders&lt;bsondocument&gt;.Update.Set(\"size.uom\", \"in\").Set(\"status\", \"P\").CurrentDate(\"lastModified\");\nvar result = collection.UpdateMany(filter, update);","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> filter = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>.<span class="lg-highlight-title lg-highlight-class">Lt</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">50</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> update = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Update</span>.<span class="lg-highlight-title lg-highlight-class">Set</span>(<span class="lg-highlight-string">"size.uom"</span>, <span class="lg-highlight-string">"in"</span>).<span class="lg-highlight-title lg-highlight-class">Set</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>).<span class="lg-highlight-title lg-highlight-class">CurrentDate</span>(<span class="lg-highlight-string">"lastModified"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> result = collection.<span class="lg-highlight-title lg-highlight-class">UpdateMany</span>(filter, update);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-163-menu" aria-describedby="select-163-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-164" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ra8:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ra8:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra8:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra8:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "in" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_1dytu7w30" class="leafygreen-ui-38lglc" id="_3ic4xuofh" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\nresult, err := coll.UpdateMany(\n\tcontext.TODO(),\n\tbson.D{\n\t\t{\"qty\", bson.D{\n\t\t\t{\"$lt\", 50},\n\t\t}},\n\t},\n\tbson.D{\n\t\t{\"$set\", bson.D{\n\t\t\t{\"size.uom\", \"cm\"},\n\t\t\t{\"status\", \"P\"},\n\t\t}},\n\t\t{\"$currentDate\", bson.D{\n\t\t\t{\"lastModified\", true},\n\t\t}},\n\t},\n)\n","programmingLanguage":"Golang"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">result<!-- -->, <!-- -->err := coll.<span class="lg-highlight-title lg-highlight-class">UpdateMany</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> context.<span class="lg-highlight-title lg-highlight-function">TODO</span>(),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$lt"</span>, <span class="lg-highlight-number">50</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$set"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"size.uom"</span>, <span class="lg-highlight-string">"cm"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$currentDate"</span>, bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"lastModified"</span>, <span class="lg-highlight-literal">true</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-166-menu" aria-describedby="select-166-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-167" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ra9:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ra9:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra9:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ra9:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "in" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_pe51zcffe" class="leafygreen-ui-38lglc" id="_dplc4lwbo" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"Publisher&lt;updateresult&gt; updateManyPublisher = collection.updateMany(lt(\"qty\", 50),\n combine(set(\"size.uom\", \"in\"), set(\"status\", \"P\"), currentDate(\"lastModified\")));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">Publisher</span>&lt;<span class="lg-highlight-title lg-highlight-class">UpdateResult</span>&gt; updateManyPublisher = collection.<span class="lg-highlight-title lg-highlight-function">updateMany</span>(<span class="lg-highlight-title lg-highlight-function">lt</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">50</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-function">combine</span>(<span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"size.uom"</span>, <span class="lg-highlight-string">"in"</span>), <span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>), <span class="lg-highlight-title lg-highlight-function">currentDate</span>(<span class="lg-highlight-string">"lastModified"</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-169-menu" aria-describedby="select-169-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-170" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:raa:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":raa:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":raa:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":raa:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "in" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_cpoil3cxv" class="leafygreen-ui-38lglc" id="_p7rhv1tap" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.updateMany(lt(\"qty\", 50),\n combine(set(\"size.uom\", \"in\"), set(\"status\", \"P\"), currentDate(\"lastModified\")));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">updateMany</span>(<span class="lg-highlight-title lg-highlight-function">lt</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">50</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-function">combine</span>(<span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"size.uom"</span>, <span class="lg-highlight-string">"in"</span>), <span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>), <span class="lg-highlight-title lg-highlight-function">currentDate</span>(<span class="lg-highlight-string">"lastModified"</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-172-menu" aria-describedby="select-172-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-173" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rab:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rab:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rab:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rab:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "in" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_vfltqmluc" class="leafygreen-ui-38lglc" id="_c3tykks7q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.updateOne(eq(\"item\", \"paper\"),\n combine(set(\"size.uom\", \"cm\"), set(\"status\", \"P\"), currentDate(\"lastModified\")));","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(<span class="lg-highlight-title lg-highlight-function">eq</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-function">combine</span>(<span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"size.uom"</span>, <span class="lg-highlight-string">"cm"</span>), <span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>), <span class="lg-highlight-title lg-highlight-function">currentDate</span>(<span class="lg-highlight-string">"lastModified"</span>)));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-175-menu" aria-describedby="select-175-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-176" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rac:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rac:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rac:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rac:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "in" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_sg63ipk4r" class="leafygreen-ui-38lglc" id="_o6ofculvd" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"await db.inventory.update_many(\n {\"qty\": {\"$lt\": 50}},\n {\"$set\": {\"size.uom\": \"in\", \"status\": \"P\"}, \"$currentDate\": {\"lastModified\": True}},\n)","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">await</span> db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">update_many</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>: {<span class="lg-highlight-string">"$lt"</span>: <span class="lg-highlight-number">50</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$set"</span>: {<span class="lg-highlight-string">"size.uom"</span>: <span class="lg-highlight-string">"in"</span>, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"P"</span>}, <span class="lg-highlight-string">"$currentDate"</span>: {<span class="lg-highlight-string">"lastModified"</span>: <span class="lg-highlight-title lg-highlight-class">True</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-178-menu" aria-describedby="select-178-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-179" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rad:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rad:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rad:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rad:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "in" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_orkxza0r8" class="" id="_ksb8wyoqt" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"await db.collection('inventory').updateMany(\n { qty: { $lt: 50 } },\n {\n $set: { 'size.uom': 'in', status: 'P' },\n $currentDate: { lastModified: true }\n }\n);","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">await</span> db.<span class="lg-highlight-title lg-highlight-function">collection</span>(<span class="lg-highlight-string">'inventory'</span>).<span class="lg-highlight-title lg-highlight-function">updateMany</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">qty</span>: <!-- -->{ <span class="lg-highlight-attr">$lt</span>: <span class="lg-highlight-number">50</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$set</span>: <!-- -->{ <span class="lg-highlight-string">'size.uom'</span>: <span class="lg-highlight-string">'in'</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">'P'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$currentDate</span>: <!-- -->{ <span class="lg-highlight-attr">lastModified</span>: <span class="lg-highlight-literal">true</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-181-menu" aria-describedby="select-181-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-182" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rae:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rae:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rae:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rae:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "in" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_ryrqde98q" class="leafygreen-ui-38lglc" id="_jq6a81bqe" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"# For boolean values, use boolean.pm for 'true' and 'false'\n$db-&gt;coll(\"inventory\")-&gt;update_many(\n { qty =&gt; { '$lt' =&gt; 50 } },\n {\n '$set' =&gt; { \"size.uom\" =&gt; \"in\", status =&gt; \"P\" },\n '$currentDate' =&gt; { lastModified =&gt; true }\n }\n);","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"># <span class="lg-highlight-title lg-highlight-class">For</span> boolean values, use boolean.<span class="lg-highlight-property">pm</span> <span class="lg-highlight-keyword">for</span> <span class="lg-highlight-string">'true'</span> and <span class="lg-highlight-string">'false'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">$db<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">coll</span>(<span class="lg-highlight-string">"inventory"</span>)<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">update_many</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-params lg-highlight-function">qty</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <!-- -->{ <span class="lg-highlight-string">'$lt'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">50</span> } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$set'</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-string">"size.uom"</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-string">"in"</span>, <span class="lg-highlight-params lg-highlight-function">status</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"P"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$currentDate'</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-params lg-highlight-function">lastModified</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-literal">true</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-184-menu" aria-describedby="select-184-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-185" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:raf:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":raf:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":raf:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":raf:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "in" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_rsruedat2" class="leafygreen-ui-38lglc" id="_mbpr44k6q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$updateResult = $db-&gt;inventory-&gt;updateMany(\n ['qty' =&gt; ['$lt' =&gt; 50]],\n [\n '$set' =&gt; ['size.uom' =&gt; 'cm', 'status' =&gt; 'P'],\n '$currentDate' =&gt; ['lastModified' =&gt; true],\n ],\n);","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$updateResult = $db-&gt;inventory-&gt;<span class="lg-highlight-title lg-highlight-function">updateMany</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [<span class="lg-highlight-string">'qty'</span> =&gt; [<span class="lg-highlight-string">'$lt'</span> =&gt; <span class="lg-highlight-number">50</span>]],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$set'</span> =&gt; [<span class="lg-highlight-string">'size.uom'</span> =&gt; <span class="lg-highlight-string">'cm'</span>, <span class="lg-highlight-string">'status'</span> =&gt; <span class="lg-highlight-string">'P'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$currentDate'</span> =&gt; [<span class="lg-highlight-string">'lastModified'</span> =&gt; <span class="lg-highlight-literal">true</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-187-menu" aria-describedby="select-187-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-188" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rag:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rag:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rag:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rag:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "in" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_wsjx14hv6" class="leafygreen-ui-38lglc" id="_m4w5cq7zo" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.update_many(\n {\"qty\": {\"$lt\": 50}},\n {\"$set\": {\"size.uom\": \"in\", \"status\": \"P\"}, \"$currentDate\": {\"lastModified\": True}},\n)","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">update_many</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>: {<span class="lg-highlight-string">"$lt"</span>: <span class="lg-highlight-number">50</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"$set"</span>: {<span class="lg-highlight-string">"size.uom"</span>: <span class="lg-highlight-string">"in"</span>, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"P"</span>}, <span class="lg-highlight-string">"$currentDate"</span>: {<span class="lg-highlight-string">"lastModified"</span>: <span class="lg-highlight-title lg-highlight-class">True</span>}},</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-190-menu" aria-describedby="select-190-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-191" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rah:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rah:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rah:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rah:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_4zo8ugqnn" class="leafygreen-ui-38lglc" id="_yvg1ier7i" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client[:inventory].update_many({ qty: { '$lt' =&gt; 50 } },\n { '$set' =&gt; { 'size.uom' =&gt; 'in', 'status' =&gt; 'P' },\n '$currentDate' =&gt; { 'lastModified' =&gt; true } })","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client<!-- -->[<!-- -->:inventory].<span class="lg-highlight-title lg-highlight-function">update_many</span>(<!-- -->{ <span class="lg-highlight-attr">qty</span>: <!-- -->{ <span class="lg-highlight-string">'$lt'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-number">50</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">'$set'</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-string">'size.uom'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-string">'in'</span>, <span class="lg-highlight-string">'status'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-string">'P'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$currentDate'</span> <!-- -->=<!-- -->&gt; <!-- -->{ <span class="lg-highlight-string">'lastModified'</span> <!-- -->=<!-- -->&gt; <span class="lg-highlight-literal">true</span> } })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-193-menu" aria-describedby="select-193-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-194" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rai:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rai:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rai:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rai:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "in" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_3x0rp5hmc" class="leafygreen-ui-38lglc" id="_au44h0bu6" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.updateMany(lt(\"qty\", 50),\n combine(set(\"size.uom\", \"in\"), set(\"status\", \"P\"), currentDate(\"lastModified\"))\n).execute()","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">updateMany</span>(<span class="lg-highlight-title lg-highlight-function">lt</span>(<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">50</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-function">combine</span>(<span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"size.uom"</span>, <span class="lg-highlight-string">"in"</span>), <span class="lg-highlight-title lg-highlight-function">set</span>(<span class="lg-highlight-string">"status"</span>, <span class="lg-highlight-string">"P"</span>), <span class="lg-highlight-title lg-highlight-function">currentDate</span>(<span class="lg-highlight-string">"lastModified"</span>))</td></tr><tr class=""><td class="leafygreen-ui-7razhx">).<span class="lg-highlight-title lg-highlight-function">execute</span>()</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-196-menu" aria-describedby="select-196-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-197" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:raj:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":raj:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":raj:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":raj:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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 update operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> size.uom </code> field to <code class="leafygreen-ui-1l06pbn"> "in" </code> and the value of the <code class="leafygreen-ui-1l06pbn"> status </code> field to <code class="leafygreen-ui-1l06pbn"> "P" </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> operator to update the value of the <code class="leafygreen-ui-1l06pbn"> lastModified </code> field to the current date. If <code class="leafygreen-ui-1l06pbn"> lastModified </code> field does not exist, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> will create the field. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/currentDate/#mongodb-update-up.-currentDate"> <code class="leafygreen-ui-1l06pbn"> $currentDate </code> </a> for details. </p> </li> </ul> </div> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Replace a Document <a class="headerlink leafygreen-ui-1kepx47" href="#replace-a-document" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="replace-a-document"> </div> </a> </h3> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-15"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_xqr2vlq1g" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_wbq6izony" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_7zque22zb" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_srkg7458h" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_r3zbmz0ic" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_zklr28xt6" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_6ueujm619" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_aj5zxmzl1" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_x6dz3c26c" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_w1r0c4bts" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_yk8c5xvc7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_8ijfe7cm2" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_w8537h5ar" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0zmp1u6zz" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_mz96rggh4" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_mi5tyhzwb" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_adyc145q7" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_6vscilki3" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_plv9e6236" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_vg1illsxo" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_y9rt905w4" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_c2v3srb2i" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_b1gj6pbow" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_uglle92sk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_bgb72keog" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_syy05k3iz" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_tnirsbk3c" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_t8rv1f3z1" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_3d151s995" class="leafygreen-ui-38lglc" id="_yqe6q9h7t" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To replace the entire content of a document except for the <code class="leafygreen-ui-1l06pbn"> _id </code> field, pass an entirely new document as the second argument to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.replaceOne/#mongodb-method-db.collection.replaceOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.replaceOne() </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> When replacing a document, the replacement document must consist of only field/value pairs. The replacement document cannot include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operators </a> expressions. </p> <p class="leafygreen-ui-1kp3ins"> The replacement document can have different fields from the original document. In the replacement document, you can omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is immutable. However, if you do include the <code class="leafygreen-ui-1l06pbn"> _id </code> field, it must have the same value as the current value. </p> <p class="leafygreen-ui-1kp3ins"> The following example replaces the <em> first </em> document from the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> item: "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_2c7btj08t" class="leafygreen-ui-38lglc" id="_bg1a5ysws" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> You can't replace a document in <!-- --> MongoDB Compass <!-- --> . To replace a document, connect to your MongoDB deployment from <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> or a MongoDB driver and follow the examples in this section for your preferred method. </p> </div> </div> </div> <div> <div aria-labelledby="_lh8yekf69" class="leafygreen-ui-38lglc" id="_44w0s5k2q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To replace the entire content of a document except for the <code class="leafygreen-ui-1l06pbn"> _id </code> field, pass an entirely new document as the second argument to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_ReplaceOne.htm" rel="noopener noreferrer"> <span> IMongoCollection.ReplaceOne() <!-- --> . </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> <p class="leafygreen-ui-1kp3ins"> When replacing a document, the replacement document must consist of only field/value pairs. The replacement document cannot include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operators </a> expressions. </p> <p class="leafygreen-ui-1kp3ins"> The replacement document can have different fields from the original document. In the replacement document, you can omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is immutable. However, if you do include the <code class="leafygreen-ui-1l06pbn"> _id </code> field, it must have the same value as the current value. </p> <p class="leafygreen-ui-1kp3ins"> The following example replaces the <em> first </em> document from the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> item: "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_3hv6htqur" class="leafygreen-ui-38lglc" id="_e3vrzz0fs" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To replace the entire content of a document except for the <code class="leafygreen-ui-1l06pbn"> _id </code> field, pass an entirely new document as the second argument to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://godoc.org/github.com/mongodb/mongo-go-driver/mongo#Collection.ReplaceOne" rel="noopener noreferrer"> <span> Collection.ReplaceOne <!-- --> . </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> <p class="leafygreen-ui-1kp3ins"> When replacing a document, the replacement document must consist of only field/value pairs. The replacement document cannot include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operators </a> expressions. </p> <p class="leafygreen-ui-1kp3ins"> The replacement document can have different fields from the original document. In the replacement document, you can omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is immutable. However, if you do include the <code class="leafygreen-ui-1l06pbn"> _id </code> field, it must have the same value as the current value. </p> <p class="leafygreen-ui-1kp3ins"> The following example replaces the <em> first </em> document from the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> item: "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_vyv54o1ce" class="leafygreen-ui-38lglc" id="_nm9fvqe7s" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To replace the entire content of a document except for the <code class="leafygreen-ui-1l06pbn"> _id </code> field, pass an entirely new document as the second argument to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver-reactivestreams/1.6/javadoc/com/mongodb/reactivestreams/client/MongoCollection.html#replaceOne(org.bson.conversions.Bson,%20TDocument)" rel="noopener noreferrer"> <span> com.mongodb.reactivestreams.client.MongoCollection.replaceOne </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> <p class="leafygreen-ui-1kp3ins"> When replacing a document, the replacement document must consist of only field/value pairs. The replacement document cannot include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operators </a> expressions. </p> <p class="leafygreen-ui-1kp3ins"> The replacement document can have different fields from the original document. In the replacement document, you can omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is immutable. However, if you do include the <code class="leafygreen-ui-1l06pbn"> _id </code> field, it must have the same value as the current value. </p> <p class="leafygreen-ui-1kp3ins"> The following example replaces the <em> first </em> document from the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> item: "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_3dozv0wjm" class="leafygreen-ui-38lglc" id="_vxokqz6vl" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To replace the entire content of a document except for the <code class="leafygreen-ui-1l06pbn"> _id </code> field, pass an entirely new document as the second argument to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/MongoCollection.html#replaceOne-org.bson.conversions.Bson-TDocument-" rel="noopener noreferrer"> <span> com.mongodb.client.MongoCollection.replaceOne <!-- --> . </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> <p class="leafygreen-ui-1kp3ins"> When replacing a document, the replacement document must consist of only field/value pairs. The replacement document cannot include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operators </a> expressions. </p> <p class="leafygreen-ui-1kp3ins"> The replacement document can have different fields from the original document. In the replacement document, you can omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is immutable. However, if you do include the <code class="leafygreen-ui-1l06pbn"> _id </code> field, it must have the same value as the current value. </p> <p class="leafygreen-ui-1kp3ins"> The following example replaces the <em> first </em> document from the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> item: "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_6t1x5rnvc" class="leafygreen-ui-38lglc" id="_dnskaq64i" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To replace the entire content of a document except for the <code class="leafygreen-ui-1l06pbn"> _id </code> field, pass an entirely new document as the second argument to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/replace-one.html" rel="noopener noreferrer"> <span> MongoCollection.replaceOne() </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> method. </p> <p class="leafygreen-ui-1kp3ins"> When replacing a document, the replacement document must consist of only field/value pairs. The replacement document cannot include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operators </a> expressions. </p> <p class="leafygreen-ui-1kp3ins"> The replacement document can have different fields from the original document. In the replacement document, you can omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is immutable. However, if you do include the <code class="leafygreen-ui-1l06pbn"> _id </code> field, it must have the same value as the current value. </p> <p class="leafygreen-ui-1kp3ins"> The following example replaces the <em> first </em> document from the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> item: "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_h1k5iroyr" class="leafygreen-ui-38lglc" id="_01n3p9dus" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To replace the entire content of a document except for the <code class="leafygreen-ui-1l06pbn"> _id </code> field, pass an entirely new document as the second argument to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_collection.html#motor.motor_asyncio.AsyncIOMotorCollection.replace_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> replace_one </code> . </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> <p class="leafygreen-ui-1kp3ins"> When replacing a document, the replacement document must consist of only field/value pairs. The replacement document cannot include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operators </a> expressions. </p> <p class="leafygreen-ui-1kp3ins"> The replacement document can have different fields from the original document. In the replacement document, you can omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is immutable. However, if you do include the <code class="leafygreen-ui-1l06pbn"> _id </code> field, it must have the same value as the current value. </p> <p class="leafygreen-ui-1kp3ins"> The following example replaces the <em> first </em> document from the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> item: "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_kf6kemakg" class="" id="_dd8m38ioe" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To replace the entire content of a document except for the <code class="leafygreen-ui-1l06pbn"> _id </code> field, pass an entirely new document as the second argument to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#replaceOne" rel="noopener noreferrer"> <span> Collection.replaceOne() <!-- --> . </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> <p class="leafygreen-ui-1kp3ins"> When replacing a document, the replacement document must consist of only field/value pairs. The replacement document cannot include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operators </a> expressions. </p> <p class="leafygreen-ui-1kp3ins"> The replacement document can have different fields from the original document. In the replacement document, you can omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is immutable. However, if you do include the <code class="leafygreen-ui-1l06pbn"> _id </code> field, it must have the same value as the current value. </p> <p class="leafygreen-ui-1kp3ins"> The following example replaces the <em> first </em> document from the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> item: "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_smjkdpzyl" class="leafygreen-ui-38lglc" id="_vzjhsd57s" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To replace the entire content of a document except for the <code class="leafygreen-ui-1l06pbn"> _id </code> field, pass an entirely new document as the second argument to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://metacpan.org/pod/MongoDB::Collection#replace_one" rel="noopener noreferrer"> <span> replace_one() <!-- --> . </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> <p class="leafygreen-ui-1kp3ins"> When replacing a document, the replacement document must consist of only field/value pairs. The replacement document cannot include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operators </a> expressions. </p> <p class="leafygreen-ui-1kp3ins"> The replacement document can have different fields from the original document. In the replacement document, you can omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is immutable. However, if you do include the <code class="leafygreen-ui-1l06pbn"> _id </code> field, it must have the same value as the current value. </p> <p class="leafygreen-ui-1kp3ins"> The following example replaces the <em> first </em> document from the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> item: "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_gvzqutp89" class="leafygreen-ui-38lglc" id="_qlsd8623x" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To replace the entire content of a document except for the <code class="leafygreen-ui-1l06pbn"> _id </code> field, pass an entirely new document as the second argument to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/php-library/upcoming/reference/method/MongoDBCollection-replaceOne/#mongodb-phpmethod-phpmethod.MongoDB-Collection--replaceOne--" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> replaceOne() </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> When replacing a document, the replacement document must consist of only field/value pairs. The replacement document cannot include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operators </a> expressions. </p> <p class="leafygreen-ui-1kp3ins"> The replacement document can have different fields from the original document. In the replacement document, you can omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is immutable. However, if you do include the <code class="leafygreen-ui-1l06pbn"> _id </code> field, it must have the same value as the current value. </p> <p class="leafygreen-ui-1kp3ins"> The following example replaces the <em> first </em> document from the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> item: "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_5k998jdkt" class="leafygreen-ui-38lglc" id="_ok5fdjvzf" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To replace the entire content of a document except for the <code class="leafygreen-ui-1l06pbn"> _id </code> field, pass an entirely new document as the second argument to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.replace_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> replace_one </code> . </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> <p class="leafygreen-ui-1kp3ins"> When replacing a document, the replacement document must consist of only field/value pairs. The replacement document cannot include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operators </a> expressions. </p> <p class="leafygreen-ui-1kp3ins"> The replacement document can have different fields from the original document. In the replacement document, you can omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is immutable. However, if you do include the <code class="leafygreen-ui-1l06pbn"> _id </code> field, it must have the same value as the current value. </p> <p class="leafygreen-ui-1kp3ins"> The following example replaces the <em> first </em> document from the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> item: "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_wky0gxwbn" class="leafygreen-ui-38lglc" id="_c3kvcqd4x" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To replace the entire content of a document except for the <code class="leafygreen-ui-1l06pbn"> _id </code> field, pass an entirely new document as the second argument to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://api.mongodb.com/ruby/current/Mongo/Collection.html#replace_one-instance_method" target="_self"> <span> replace_one() <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> When replacing a document, the replacement document must consist of only field/value pairs. The replacement document cannot include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operators </a> expressions. </p> <p class="leafygreen-ui-1kp3ins"> The replacement document can have different fields from the original document. In the replacement document, you can omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is immutable. However, if you do include the <code class="leafygreen-ui-1l06pbn"> _id </code> field, it must have the same value as the current value. </p> <p class="leafygreen-ui-1kp3ins"> The following example replaces the <em> first </em> document from the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> item: "paper" </code> : </p> </div> </div> </div> <div> <div aria-labelledby="_8as7jbm0k" class="leafygreen-ui-38lglc" id="_cy8f1aj7q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To replace the entire content of a document except for the <code class="leafygreen-ui-1l06pbn"> _id </code> field, pass an entirely new document as the second argument to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-scala-driver/2.9/scaladoc/org/mongodb/scala/MongoCollection.html#replaceOne(filter:org.mongodb.scala.bson.conversions.Bson,replacement:TResult,options:org.mongodb.scala.model.UpdateOptions):org.mongodb.scala.SingleObservable[org.mongodb.scala.result.UpdateResult]" rel="noopener noreferrer"> <span> replaceOne() </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> <p class="leafygreen-ui-1kp3ins"> When replacing a document, the replacement document must consist of only field/value pairs. The replacement document cannot include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-top-level"> update operators </a> expressions. </p> <p class="leafygreen-ui-1kp3ins"> The replacement document can have different fields from the original document. In the replacement document, you can omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is immutable. However, if you do include the <code class="leafygreen-ui-1l06pbn"> _id </code> field, it must have the same value as the current value. </p> <p class="leafygreen-ui-1kp3ins"> The following example replaces the <em> first </em> document from the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> item: "paper" </code> : </p> </div> </div> </div> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-16"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_50wbrpj5q" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_x9hssi55u" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_a0coq1vmn" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_sz2brxuiw" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C </div> </button> <button aria-controls="_k2wigylxi" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_nbb0qrbas" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_4pdajxe0v" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_q9256mgwk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_92sp2pv0x" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_6kwhbpy0j" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_zm0godia7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_addh57yyt" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_er8tavugb" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5zsioukzn" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_gt7u8o5u8" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_prd8bpmgw" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_sza0ybp6c" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_t3w7ehmf1" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_d5c9h2oim" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_esc7y5uv9" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_my6yb2u1h" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_zkpg47dnx" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_l53bsi41p" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_x7gxjqhsl" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_njt6s73g9" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_c0gezk168" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_af9q8m5db" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_qsc5el2av" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_2594flyvg" class="leafygreen-ui-38lglc" id="_fm4ayw9vq" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.replaceOne(\n { item: \"paper\" },\n { item: \"paper\", instock: [ { warehouse: \"A\", qty: 60 }, { warehouse: \"B\", qty: 40 } ] }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">replaceOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"paper"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"paper"</span>, <span class="lg-highlight-attr">instock</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">warehouse</span>: <span class="lg-highlight-string">"A"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">60</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">warehouse</span>: <span class="lg-highlight-string">"B"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">40</span> } ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-199-menu" aria-describedby="select-199-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-200" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rak:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rak:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rak:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rak:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_1iur5eqb5" class="leafygreen-ui-38lglc" id="_sg89keg1e" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongoc_collection_t *collection;\nbson_t *selector;\nbson_t *replacement;\nbool r;\nbson_error_t error;\n\ncollection = mongoc_database_get_collection (db, \"inventory\");\nselector = BCON_NEW (\"item\", BCON_UTF8 (\"paper\"));\nreplacement = BCON_NEW (\n \"item\", BCON_UTF8 (\"paper\"),\n \"instock\", \"[\",\n \"{\",\n \"warehouse\", BCON_UTF8 (\"A\"),\n \"qty\", BCON_INT64 (60),\n \"}\",\"{\",\n \"warehouse\", BCON_UTF8 (\"B\"),\n \"qty\", BCON_INT64 (40),\n \"}\",\n \"]\");\n\n/* MONGOC_UPDATE_NONE means \"no special options\" */\nr = mongoc_collection_replace_one(collection, selector, replacement, NULL, NULL, &amp;error);\nbson_destroy (selector);\nbson_destroy (replacement);\n\nif (!r) {\n MONGOC_ERROR (\"%s\\n\", error.message);\n goto done;\n}","programmingLanguage":"C"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongoc_collection_t *collection;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *selector;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_t *replacement;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bool r;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_error_t error;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">collection <!-- -->= <!-- -->mongoc_database_get_collection (db<!-- -->, <span class="lg-highlight-string">"inventory"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">selector <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (<!-- --><!-- --><span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> <!-- -->(<span class="lg-highlight-string">"paper"</span>));</td></tr><tr class=""><td class="leafygreen-ui-7razhx">replacement <!-- -->= <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_NEW</span> (</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"paper"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"instock"</span>, <span class="lg-highlight-string">"["</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"warehouse"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"A"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">60</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,<span class="lg-highlight-string">"{"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"warehouse"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_UTF8</span> (<!-- --><span class="lg-highlight-string">"B"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"qty"</span>, <!-- --><span class="lg-highlight-variable lg-highlight-constant">BCON_INT64</span> (<!-- --><span class="lg-highlight-number">40</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"}"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"]"</span>)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">/* MONGOC_UPDATE_NONE means "no special options" */</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">r <!-- -->= <!-- --><span class="lg-highlight-title lg-highlight-function">mongoc_collection_replace_one</span>(collection, selector<!-- -->, replacement, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, <span class="lg-highlight-variable lg-highlight-constant">NULL</span>, &amp;error);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->selector);</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bson_destroy <!-- -->(<!-- -->replacement);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->!r) {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- --><span class="lg-highlight-variable lg-highlight-constant">MONGOC_ERROR</span> (<span class="lg-highlight-string">"%s</span><!-- --><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">"</span>, error.<span class="lg-highlight-property">message</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> goto done;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-202-menu" aria-describedby="select-202-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-203" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ral:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ral:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ral:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ral:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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"> Be sure to also clean up any open resources by calling the following methods, as appropriate: </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="http://mongoc.org/libbson/current/bson_destroy.html" rel="noopener noreferrer"> <span> bson_destroy </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongoc.org/libmongoc/current/mongoc_bulk_operation_destroy.html" rel="noopener noreferrer"> <span> mongoc_bulk_operation_destroy </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongoc.org/libmongoc/current/mongoc_collection_destroy" rel="noopener noreferrer"> <span> mongoc_collection_destroy </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongoc.org/libmongoc/current/mongoc_cursor_destroy.html" rel="noopener noreferrer"> <span> mongoc_cursor_destroy <!-- --> , </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> </div> </div> </div> <div> <div aria-labelledby="_iylt34hg8" class="leafygreen-ui-38lglc" id="_y2svx47u4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var filter = Builders&lt;bsondocument&gt;.Filter.Eq(\"item\", \"paper\");\nvar replacement = new BsonDocument\n{\n { \"item\", \"paper\" },\n { \"instock\", new BsonArray\n {\n new BsonDocument { { \"warehouse\", \"A\" }, { \"qty\", 60 } },\n new BsonDocument { { \"warehouse\", \"B\" }, { \"qty\", 40 } } }\n }\n};\nvar result = collection.ReplaceOne(filter, replacement);","programmingLanguage":"C#"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> filter = <span class="lg-highlight-title lg-highlight-class">Builders</span>&lt;<span class="lg-highlight-title lg-highlight-class">BsonDocument</span>&gt;.<span class="lg-highlight-property">Filter</span>.<span class="lg-highlight-title lg-highlight-class">Eq</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>);</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> replacement = <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"instock"</span>, <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonArray</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span> { { <span class="lg-highlight-string">"warehouse"</span>, <span class="lg-highlight-string">"A"</span> }, { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">60</span> } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">BsonDocument</span> { { <span class="lg-highlight-string">"warehouse"</span>, <span class="lg-highlight-string">"B"</span> }, { <span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">40</span> } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">};</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> result = collection.<span class="lg-highlight-title lg-highlight-class">ReplaceOne</span>(filter, replacement);</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-205-menu" aria-describedby="select-205-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-206" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ram:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ram:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ram:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ram:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_nencr8qi0" class="leafygreen-ui-38lglc" id="_s53iglk8a" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\nresult, err := coll.ReplaceOne(\n\tcontext.TODO(),\n\tbson.D{\n\t\t{\"item\", \"paper\"},\n\t},\n\tbson.D{\n\t\t{\"item\", \"paper\"},\n\t\t{\"instock\", bson.A{\n\t\t\tbson.D{\n\t\t\t\t{\"warehouse\", \"A\"},\n\t\t\t\t{\"qty\", 60},\n\t\t\t},\n\t\t\tbson.D{\n\t\t\t\t{\"warehouse\", \"B\"},\n\t\t\t\t{\"qty\", 40},\n\t\t\t},\n\t\t}},\n\t},\n)\n","programmingLanguage":"Golang"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">result<!-- -->, <!-- -->err := coll.<span class="lg-highlight-title lg-highlight-class">ReplaceOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> context.<span class="lg-highlight-title lg-highlight-function">TODO</span>(),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"instock"</span>, bson.<span class="lg-highlight-property">A</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"warehouse"</span>, <span class="lg-highlight-string">"A"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">60</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> bson.<span class="lg-highlight-property">D</span>{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"warehouse"</span>, <span class="lg-highlight-string">"B"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"qty"</span>, <span class="lg-highlight-number">40</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-208-menu" aria-describedby="select-208-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-209" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ran:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ran:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ran:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ran:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_sun4zyy28" class="leafygreen-ui-38lglc" id="_ed9a5ut5m" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"Publisher&lt;updateresult&gt; replaceOnePublisher = collection.replaceOne(eq(\"item\", \"paper\"),\n Document.parse(\"{ item: 'paper', instock: [ { warehouse: 'A', qty: 60 }, { warehouse: 'B', qty: 40 } ] }\"));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">Publisher</span>&lt;<span class="lg-highlight-title lg-highlight-class">UpdateResult</span>&gt; replaceOnePublisher = collection.<span class="lg-highlight-title lg-highlight-function">replaceOne</span>(<span class="lg-highlight-title lg-highlight-function">eq</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'paper', instock: [ { warehouse: 'A', qty: 60 }, { warehouse: 'B', qty: 40 } ] }"</span>));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-211-menu" aria-describedby="select-211-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-212" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rao:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rao:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rao:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rao:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_x8ptzcagw" class="leafygreen-ui-38lglc" id="_3em8ry16r" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.replaceOne(eq(\"item\", \"paper\"),\n Document.parse(\"{ item: 'paper', instock: [ { warehouse: 'A', qty: 60 }, { warehouse: 'B', qty: 40 } ] }\"));","programmingLanguage":"Java"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">replaceOne</span>(<span class="lg-highlight-title lg-highlight-function">eq</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'paper', instock: [ { warehouse: 'A', qty: 60 }, { warehouse: 'B', qty: 40 } ] }"</span>));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-214-menu" aria-describedby="select-214-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-215" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rap:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rap:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rap:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rap:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_eboy21d1o" class="leafygreen-ui-38lglc" id="_l0p52kjar" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.replaceOne(eq(\"item\", \"paper\"),\n Document.parse(\"{ item: 'paper', instock: [ { warehouse: 'A', qty: 60 }, { warehouse: 'B', qty: 40 } ] }\"));","programmingLanguage":"Kotlin"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">replaceOne</span>(<span class="lg-highlight-title lg-highlight-function">eq</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>.<span class="lg-highlight-title lg-highlight-function">parse</span>(<span class="lg-highlight-string">"{ item: 'paper', instock: [ { warehouse: 'A', qty: 60 }, { warehouse: 'B', qty: 40 } ] }"</span>));</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-217-menu" aria-describedby="select-217-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-218" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:raq:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":raq:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":raq:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":raq:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_r867loos1" class="leafygreen-ui-38lglc" id="_5gatverb8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"await db.inventory.replace_one(\n {\"item\": \"paper\"},\n {\n \"item\": \"paper\",\n \"instock\": [{\"warehouse\": \"A\", \"qty\": 60}, {\"warehouse\": \"B\", \"qty\": 40}],\n },\n)","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">await</span> db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">replace_one</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"paper"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"paper"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"instock"</span>: [{<span class="lg-highlight-string">"warehouse"</span>: <span class="lg-highlight-string">"A"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">60</span>}, {<span class="lg-highlight-string">"warehouse"</span>: <span class="lg-highlight-string">"B"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">40</span>}],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-220-menu" aria-describedby="select-220-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-221" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rar:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rar:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rar:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rar:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_a92ove0i2" class="" id="_kyduc2uuu" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"await db.collection('inventory').replaceOne(\n { item: 'paper' },\n {\n item: 'paper',\n instock: [\n { warehouse: 'A', qty: 60 },\n { warehouse: 'B', qty: 40 }\n ]\n }\n);","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">await</span> db.<span class="lg-highlight-title lg-highlight-function">collection</span>(<span class="lg-highlight-string">'inventory'</span>).<span class="lg-highlight-title lg-highlight-function">replaceOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'paper'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'paper'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">instock</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">warehouse</span>: <span class="lg-highlight-string">'A'</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">60</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">warehouse</span>: <span class="lg-highlight-string">'B'</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">40</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-223-menu" aria-describedby="select-223-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-224" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:ras:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":ras:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ras:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":ras:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_w2negxgmq" class="leafygreen-ui-38lglc" id="_2i5tbgfjs" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$db-&gt;coll(\"inventory\")-&gt;replace_one(\n { item =&gt; \"paper\" },\n {\n item =&gt; \"paper\",\n instock =&gt; [ { warehouse =&gt; \"A\", qty =&gt; 60 }, { warehouse =&gt; \"B\", qty =&gt; 40 } ]\n }\n);","programmingLanguage":"Perl"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$db<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">coll</span>(<span class="lg-highlight-string">"inventory"</span>)<!-- -->-<!-- -->&gt;<!-- --><!-- --><span class="lg-highlight-title lg-highlight-function">replace_one</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-params lg-highlight-function">item</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"paper"</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">item</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"paper"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-params lg-highlight-function">instock</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <!-- -->[ { <span class="lg-highlight-params lg-highlight-function">warehouse</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"A"</span>, <span class="lg-highlight-params lg-highlight-function">qty</span><!-- --><span class="lg-highlight-function"> =&gt;</span> <!-- --><span class="lg-highlight-number">60</span> }, { <span class="lg-highlight-params lg-highlight-function">warehouse</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-string">"B"</span>, <span class="lg-highlight-params lg-highlight-function">qty</span><span class="lg-highlight-function"> =&gt;</span> <span class="lg-highlight-number">40</span> } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-226-menu" aria-describedby="select-226-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-227" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rat:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rat:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rat:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rat:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_puxpli5iq" class="leafygreen-ui-38lglc" id="_fdqz7p1r5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$updateResult = $db-&gt;inventory-&gt;replaceOne(\n ['item' =&gt; 'paper'],\n [\n 'item' =&gt; 'paper',\n 'instock' =&gt; [\n ['warehouse' =&gt; 'A', 'qty' =&gt; 60],\n ['warehouse' =&gt; 'B', 'qty' =&gt; 40],\n ],\n ],\n);","programmingLanguage":"PHP"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$updateResult = $db-&gt;inventory-&gt;<span class="lg-highlight-title lg-highlight-function">replaceOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [<span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'paper'</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'item'</span> =&gt; <span class="lg-highlight-string">'paper'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'instock'</span> =&gt; [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [<span class="lg-highlight-string">'warehouse'</span> =&gt; <span class="lg-highlight-string">'A'</span>, <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">60</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [<span class="lg-highlight-string">'warehouse'</span> =&gt; <span class="lg-highlight-string">'B'</span>, <span class="lg-highlight-string">'qty'</span> =&gt; <span class="lg-highlight-number">40</span>],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-229-menu" aria-describedby="select-229-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-230" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rau:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rau:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rau:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rau:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_ou5w7a160" class="leafygreen-ui-38lglc" id="_youqzrgcp" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.replace_one(\n {\"item\": \"paper\"},\n {\n \"item\": \"paper\",\n \"instock\": [{\"warehouse\": \"A\", \"qty\": 60}, {\"warehouse\": \"B\", \"qty\": 40}],\n },\n)","programmingLanguage":"Python"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">replace_one</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {<span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"paper"</span>},</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"paper"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"instock"</span>: [{<span class="lg-highlight-string">"warehouse"</span>: <span class="lg-highlight-string">"A"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">60</span>}, {<span class="lg-highlight-string">"warehouse"</span>: <span class="lg-highlight-string">"B"</span>, <span class="lg-highlight-string">"qty"</span>: <span class="lg-highlight-number">40</span>}],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-232-menu" aria-describedby="select-232-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-233" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rav:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rav:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rav:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rav:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_2rpid2nwn" class="leafygreen-ui-38lglc" id="_w4uchmm6v" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client[:inventory].replace_one({ item: 'paper' },\n { item: 'paper',\n instock: [ { warehouse: 'A', qty: 60 },\n { warehouse: 'B', qty: 40 } ] })","programmingLanguage":"Ruby"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client<!-- -->[<!-- -->:inventory].<span class="lg-highlight-title lg-highlight-function">replace_one</span>(<!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'paper'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'paper'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">instock</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">warehouse</span>: <span class="lg-highlight-string">'A'</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">60</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">warehouse</span>: <span class="lg-highlight-string">'B'</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">40</span> } ] })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-235-menu" aria-describedby="select-235-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-236" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rb0:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rb0:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rb0:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rb0:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> <div> <div aria-labelledby="_jj7xy7h53" class="leafygreen-ui-38lglc" id="_6zkfr1xhg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collection.replaceOne(equal(\"item\", \"paper\"),\n Document(\"\"\"{ item: \"paper\", instock: [ { warehouse: \"A\", qty: 60 }, { warehouse: \"B\", qty: 40 } ] }\"\"\")\n).execute()","programmingLanguage":"Scala"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collection.<span class="lg-highlight-title lg-highlight-function">replaceOne</span>(<span class="lg-highlight-title lg-highlight-function">equal</span>(<span class="lg-highlight-string">"item"</span>, <span class="lg-highlight-string">"paper"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">Document</span>(<span class="lg-highlight-string">""</span><span class="lg-highlight-string">"{ item: "</span>paper<span class="lg-highlight-string">", instock: [ { warehouse: "</span>A<span class="lg-highlight-string">", qty: 60 }, { warehouse: "</span>B<span class="lg-highlight-string">", qty: 40 } ] }"</span><span class="lg-highlight-string">""</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">).<span class="lg-highlight-title lg-highlight-function">execute</span>()</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-238-menu" aria-describedby="select-238-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-239" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:rb1:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":rb1:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rb1:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":rb1:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <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> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-update-documents-atlas-ui"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Update a Document with MongoDB Atlas <a class="headerlink leafygreen-ui-1kepx47" href="#update-a-document-with-mongodb-atlas" 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="update-a-document-with-mongodb-atlas"> </div> </a> </h2> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can update only one document at a time in the MongoDB Atlas UI. To update multiple documents or replace an entire document, connect to your Atlas deployment from <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> or a MongoDB driver and follow the examples on this page for your preferred method. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The example in this section uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/sample-data/sample-supplies/" target="_self"> <span> sample supplies dataset </span> </a> . To learn how to load the sample dataset into your MongoDB Atlas deployment, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/sample-data/#std-label-load-sample-data" target="_self"> <span> Load Sample Data <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> To update a document in MongoDB Atlas, follow these steps: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"If it's not already displayed, select the organization that\ncontains your desired project from the Organizations menu in the\nnavigation bar.If it's not already displayed, select your project\nfrom the Projects menu in the navigation bar.If it's not already displayed, click Clusters in the\nsidebar.The Clusters page displays.","name":"In the MongoDB Atlas UI, go to the Clusters page for your project."},{"@type":"HowToStep","text":"For the cluster that contains the sample data, click Browse Collections.In the left navigation pane, select the sample_supplies database.Select the sales collection.","name":"Navigate to the collection."},{"@type":"HowToStep","text":"You can specify a query filter document\nin the Filter field. A query filter document uses\nquery operators to specify search conditions.Copy the following query filter document into the\nFilter search bar and click Apply:This query filter returns all documents in the sample_supplies.sales\ncollection where saleDate is on or between January 1 and 2, 2016\nUTC time.","name":"Specify a query filter document."},{"@type":"HowToStep","text":"To edit a document displayed in the query results, hover over the\ndocument and click on the pencil icon. In the document editor, you can:Add a new field.Delete an existing field.Edit a field's name, value, or type.Revert a specific change.For detailed instructions, see Create, View, Update, and Delete Documents.","name":"Edit a document."},{"@type":"HowToStep","text":"To confirm and save your changes, click the Update button.","name":"Save your changes."}],"name":"Update a Document with MongoDB Atlas","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> In the MongoDB Atlas UI, go to the <span class="guilabel css-h15tq0"> Clusters </span> page for your project. <a class="headerlink leafygreen-ui-1kepx47" href="#in-the-mongodb-atlas-ui--go-to-the-clusters-page-for-your-project." 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="in-the-mongodb-atlas-ui--go-to-the-clusters-page-for-your-project."> </div> </a> </h3> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If it's not already displayed, select the organization that contains your desired project from the <i class="mms-icon-office mms-icon"> </i> <span class="guilabel css-h15tq0"> Organizations </span> menu <!-- --> in the navigation bar. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If it's not already displayed, select your project from the <span class="guilabel css-h15tq0"> Projects </span> menu in the navigation bar. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If it's not already displayed, click <span class="guilabel css-h15tq0"> Clusters </span> in the sidebar. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://cloud.mongodb.com/go?l=https%3A%2F%2Fcloud.mongodb.com%2Fv2%2F%3Cproject%3E%23%2Fclusters" target="_self"> <span> Clusters </span> </a> page displays. </p> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Navigate to the collection. <a class="headerlink leafygreen-ui-1kepx47" href="#navigate-to-the-collection." 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="navigate-to-the-collection."> </div> </a> </h3> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For the cluster that contains the sample data, click <span class="guilabel css-h15tq0"> Browse Collections </span> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In the left navigation pane, select the <code class="leafygreen-ui-1l06pbn"> sample_supplies </code> database. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Select the <code class="leafygreen-ui-1l06pbn"> sales </code> collection. </p> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify a query filter document. <a class="headerlink leafygreen-ui-1kepx47" href="#specify-a-query-filter-document." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="specify-a-query-filter-document."> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can specify a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-query-filter"> query filter document </a> in the <span class="guilabel css-h15tq0"> Filter </span> field. A query filter document uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/reference/supported-operations/#std-label-csfle-supported-query-operators"> query operators </a> to specify search conditions. </p> <p class="leafygreen-ui-1kp3ins"> Copy the following query filter document into the <span class="guilabel css-h15tq0"> Filter </span> search bar and click <span class="guilabel css-h15tq0"> Apply </span> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ saleDate: { $gte: { $date: \"2016-01-01T00:00-00:00\" }, $lte: { $date: \"2016-01-02T00:00-00:00\" } } }","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">{ <span class="lg-highlight-attr">saleDate</span>: <!-- -->{ <span class="lg-highlight-attr">$gte</span>: <!-- -->{ <span class="lg-highlight-attr">$date</span>: <span class="lg-highlight-string">"2016-01-01T00:00-00:00"</span> }<!-- -->, <span class="lg-highlight-attr">$lte</span>: <!-- -->{ <span class="lg-highlight-attr">$date</span>: <span class="lg-highlight-string">"2016-01-02T00:00-00:00"</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"> This query filter returns all documents in the <code class="leafygreen-ui-1l06pbn"> sample_supplies.sales </code> collection where <code class="leafygreen-ui-1l06pbn"> saleDate </code> is on or between January 1 and 2, 2016 UTC time. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Edit a document. <a class="headerlink leafygreen-ui-1kepx47" href="#edit-a-document." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="edit-a-document."> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To edit a document displayed in the query results, hover over the document and click on the pencil icon. In the document editor, you can: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Add a new field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Delete an existing field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Edit a field's name, value, or type. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Revert a specific change. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For detailed instructions, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-ui/documents/#edit-one-document" target="_self"> <span> Create, View, Update, and Delete Documents <!-- --> . </span> </a> </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Save your changes. <a class="headerlink leafygreen-ui-1kepx47" href="#save-your-changes." 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="save-your-changes."> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To confirm and save your changes, click the <span class="guilabel css-h15tq0"> Update </span> button. </p> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Atomicity <a class="headerlink leafygreen-ui-1kepx47" href="#atomicity" 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="atomicity"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> All write operations in MongoDB are atomic on the level of a single document. For more information on MongoDB and atomicity, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/write-operations-atomicity/"> Atomicity and Transactions <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> _id </code> Field <a class="headerlink leafygreen-ui-1kepx47" href="#_id-field" 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="_id-field"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Once set, you cannot update the value of the <code class="leafygreen-ui-1l06pbn"> _id </code> field nor can you replace an existing document with a replacement document that has a different <code class="leafygreen-ui-1l06pbn"> _id </code> field value. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Field Order <a class="headerlink leafygreen-ui-1kepx47" href="#field-order" 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="field-order"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> For write operations, MongoDB preserves the order of the document fields <em> except </em> for the following cases: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> _id </code> field is always the first field in the document. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Updates that include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/rename/#mongodb-update-up.-rename"> <code class="leafygreen-ui-1l06pbn"> renaming </code> </a> of field names may result in the reordering of fields in the document. </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-write-operations-upsert-behavior"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Upsert Option <a class="headerlink leafygreen-ui-1kepx47" href="#upsert-option" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upsert-option"> </div> </a> </h3> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-28"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_73utwt2v7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_xbtius3rd" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_pcfl6p4h6" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5wbgccnjn" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_larhew8pt" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_f529gy8gk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_6dvhrccwb" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_iwz1cnv41" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_yt2zjpbhd" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ykrtjeo4b" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_vztswk0q3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_032dklpj4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_d3qsmaiea" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ae5pv68zo" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_lulmfc3zi" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9q56tpl9z" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_6jswntqfl" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_a2g4nqnsz" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_g7wcnmq8h" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_mwuvfy73l" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_6b94vdnx3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_gc5h8d2jd" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_ezt3p0e74" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2iir2m02i" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_41te0j0pn" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_v3re4pgc4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_pjmosw6kk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_xb3zzzret" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_kpuaikuwv" class="leafygreen-ui-38lglc" id="_s9e8cluk2" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#mongodb-method-db.collection.updateOne"> <code class="leafygreen-ui-1l06pbn"> updateOne() </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateMany/#mongodb-method-db.collection.updateMany"> <code class="leafygreen-ui-1l06pbn"> updateMany() </code> </a> , or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.replaceOne/#mongodb-method-db.collection.replaceOne"> <code class="leafygreen-ui-1l06pbn"> replaceOne() </code> </a> includes <code class="leafygreen-ui-1l06pbn"> upsert : true </code> <strong> and </strong> no documents match the specified filter, then the operation creates a new document and inserts it. If there are matching documents, then the operation modifies or replaces the matching document or documents. </p> <p class="leafygreen-ui-1kp3ins"> For details on the new document created, see the individual reference pages for the methods. </p> </div> </div> </div> <div> <div aria-labelledby="_9ukk7luyj" class="leafygreen-ui-38lglc" id="_l20dy05yh" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The upsert option is not available through <!-- --> MongoDB Compass <!-- --> . </p> </div> </div> </div> <div> <div aria-labelledby="_1kmj58iha" class="leafygreen-ui-38lglc" id="_ct795mjvj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_UpdateOne.htm" rel="noopener noreferrer"> <span> UpdateOne() </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://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_UpdateMany.htm" rel="noopener noreferrer"> <span> UpdateMany() </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> , or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_ReplaceOne.htm" rel="noopener noreferrer"> <span> ReplaceOne() </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> includes an <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/T_MongoDB_Driver_UpdateOptions.htm" rel="noopener noreferrer"> <span> UpdateOptions </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> argument instance with the <code class="leafygreen-ui-1l06pbn"> IsUpsert </code> option set to <code class="leafygreen-ui-1l06pbn"> true </code> <strong> and </strong> no documents match the specified filter, then the operation creates a new document and inserts it. If there are matching documents, then the operation modifies or replaces the matching document or documents. </p> <p class="leafygreen-ui-1kp3ins"> For details on the new document created, see the individual reference pages for the methods. </p> </div> </div> </div> <div> <div aria-labelledby="_qeibz93pg" class="leafygreen-ui-38lglc" id="_b0jkxulw4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://godoc.org/github.com/mongodb/mongo-go-driver/mongo#Collection.UpdateOne" rel="noopener noreferrer"> <span> Collection.UpdateOne </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> includes the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://godoc.org/github.com/mongodb/mongo-go-driver/mongo/options#UpdateOptions" rel="noopener noreferrer"> <span> Upsert option set to true </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> <strong> and </strong> no documents match the specified filter, then the operation creates a new document and inserts it. If there are matching documents, then the operation modifies or replaces the matching document or documents. </p> <p class="leafygreen-ui-1kp3ins"> For details on the new document created, see the individual reference pages for the methods. </p> </div> </div> </div> <div> <div aria-labelledby="_5ndzm9808" class="leafygreen-ui-38lglc" id="_08chf0i9b" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If the update and replace methods include the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/model/UpdateOptions.html" rel="noopener noreferrer"> <span> UpdateOptions </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> parameter that specifies <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/model/UpdateOptions.html?_ga=2.189375400.2069485991.1506612687-1453986945.1494866912&amp;_gac=1.246606128.1506106401.EAIaIQobChMI3tmcxbu51gIVUrnACh12qwkREAAYASABEgLH4PD_BwE#upsert-boolean-" rel="noopener noreferrer"> <span> UpdateOptions.upsert(true) </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> <strong> and </strong> no documents match the specified filter, then the operation creates a new document and inserts it. If there are matching documents, then the operation modifies or replaces the matching document or documents. </p> <p class="leafygreen-ui-1kp3ins"> For details on the new document created, see the individual reference pages for the methods. </p> </div> </div> </div> <div> <div aria-labelledby="_iroch0un0" class="leafygreen-ui-38lglc" id="_376sn746e" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If the update and replace methods include the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/model/UpdateOptions.html" rel="noopener noreferrer"> <span> com.mongodb.client.model.UpdateOptions </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> parameter that specifies <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/model/UpdateOptions.html#upsert-boolean-" rel="noopener noreferrer"> <span> com.mongodb.client.model.UpdateOptions.upsert(true) </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> <strong> and </strong> no documents match the specified filter, then the operation creates a new document and inserts it. If there are matching documents, then the operation modifies or replaces the matching document or documents. </p> <p class="leafygreen-ui-1kp3ins"> For details on the new document created, see the individual reference pages for the methods. </p> </div> </div> </div> <div> <div aria-labelledby="_y80ac1ict" class="leafygreen-ui-38lglc" id="_hxrgetens" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If the update and replace methods include the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-core/com/mongodb/client/model/UpdateOptions.html" rel="noopener noreferrer"> <span> com.mongodb.client.model.UpdateOptions </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> parameter that specifies <code class="leafygreen-ui-1l06pbn"> upsert(true) </code> , <strong> and </strong> no documents match the specified filter, then the operation creates a new document and inserts it. If there are matching documents, then the operation modifies or replaces the matching document or documents. </p> <p class="leafygreen-ui-1kp3ins"> For details on the new document created, see the individual reference pages for the methods. </p> </div> </div> </div> <div> <div aria-labelledby="_cae8hkf2b" class="leafygreen-ui-38lglc" id="_fqaed5vgz" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_collection.html#motor.motor_asyncio.AsyncIOMotorCollection.update_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> update_one </code> </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://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_collection.html#motor.motor_asyncio.AsyncIOMotorCollection.update_many" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> update_many </code> </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> , or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_collection.html#motor.motor_asyncio.AsyncIOMotorCollection.replace_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> replace_one </code> </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> includes <code class="leafygreen-ui-1l06pbn"> upsert : true </code> <strong> and </strong> no documents match the specified filter, then the operation creates a new document and inserts it. If there are matching documents, then the operation modifies or replaces the matching document or documents. </p> <p class="leafygreen-ui-1kp3ins"> For details on the new document created, see the individual reference pages for the methods. </p> </div> </div> </div> <div> <div aria-labelledby="_1p8t1yhyw" class="" id="_mesi803ss" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#updateOne" rel="noopener noreferrer"> <span> updateOne() </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="http://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#updateMany" rel="noopener noreferrer"> <span> updateMany() </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> , or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#replaceOne" rel="noopener noreferrer"> <span> replaceOne() </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> include <code class="leafygreen-ui-1l06pbn"> upsert : true </code> in the <code class="leafygreen-ui-1l06pbn"> options </code> parameter document <strong> and </strong> no documents match the specified filter, then the operation creates a new document and inserts it. If there are matching documents, then the operation modifies or replaces the matching document or documents. </p> <p class="leafygreen-ui-1kp3ins"> For details on the new document created, see the individual reference pages for the methods. </p> </div> </div> </div> <div> <div aria-labelledby="_k22b88l6d" class="leafygreen-ui-38lglc" id="_225zt5l5o" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://metacpan.org/pod/MongoDB::Collection#update_one" rel="noopener noreferrer"> <span> update_one() </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://metacpan.org/pod/MongoDB::Collection#update_many" rel="noopener noreferrer"> <span> update_many() </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> , or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://metacpan.org/pod/MongoDB::Collection#replace_one" rel="noopener noreferrer"> <span> replace_one() </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> includes <code class="leafygreen-ui-1l06pbn"> upsert =&gt; true </code> <strong> and </strong> no documents match the specified filter, then the operation creates a new document and inserts it. If there are matching documents, then the operation modifies or replaces the matching document or documents. </p> <p class="leafygreen-ui-1kp3ins"> For details on the new document created, see the individual reference pages for the methods. </p> </div> </div> </div> <div> <div aria-labelledby="_ra1a4dx6y" class="leafygreen-ui-38lglc" id="_qkqvc6rzx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/php-library/upcoming/reference/method/MongoDBCollection-updateOne/#mongodb-phpmethod-phpmethod.MongoDB-Collection--updateOne--" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> updateOne() </code> </span> </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/php-library/upcoming/reference/method/MongoDBCollection-updateMany/#mongodb-phpmethod-phpmethod.MongoDB-Collection--updateMany--" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> updateMany() </code> </span> </a> , or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/php-library/upcoming/reference/method/MongoDBCollection-replaceOne/#mongodb-phpmethod-phpmethod.MongoDB-Collection--replaceOne--" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> replaceOne() </code> </span> </a> includes <code class="leafygreen-ui-1l06pbn"> upsert =&gt; true </code> <strong> and </strong> no documents match the specified filter, then the operation creates a new document and inserts it. If there are matching documents, then the operation modifies or replaces the matching document or documents. </p> <p class="leafygreen-ui-1kp3ins"> For details on the new document created, see the individual reference pages for the methods. </p> </div> </div> </div> <div> <div aria-labelledby="_pj6cdqyjm" class="leafygreen-ui-38lglc" id="_qtk9pkuj4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.update_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> update_one </code> </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://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.update_many" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> update_many </code> </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> , or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.replace_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> replace_one </code> </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> includes <code class="leafygreen-ui-1l06pbn"> upsert : true </code> <strong> and </strong> no documents match the specified filter, then the operation creates a new document and inserts it. If there are matching documents, then the operation modifies or replaces the matching document or documents. </p> <p class="leafygreen-ui-1kp3ins"> For details on the new document created, see the individual reference pages for the methods. </p> </div> </div> </div> <div> <div aria-labelledby="_f3x4hk6t6" class="leafygreen-ui-38lglc" id="_oc6rq60dx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://api.mongodb.com/ruby/current/Mongo/Collection.html#update_one-instance_method" target="_self"> <span> update_one() </span> </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://api.mongodb.com/ruby/current/Mongo/Collection.html#update_many-instance_method" target="_self"> <span> update_many() </span> </a> , or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://api.mongodb.com/ruby/current/Mongo/Collection.html#replace_one-instance_method" target="_self"> <span> replace_one() </span> </a> includes <code class="leafygreen-ui-1l06pbn"> upsert =&gt; true </code> <strong> and </strong> no documents match the specified filter, then the operation creates a new document and inserts it. If there are matching documents, then the operation modifies or replaces the matching document or documents. </p> <p class="leafygreen-ui-1kp3ins"> For details on the new document created, see the individual reference pages for the methods. </p> </div> </div> </div> <div> <div aria-labelledby="_sz0im7izu" class="leafygreen-ui-38lglc" id="_j1pq1ly0b" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-scala-driver/2.9/scaladoc/org/mongodb/scala/MongoCollection.html#updateOne(filter:org.mongodb.scala.bson.conversions.Bson,update:org.mongodb.scala.bson.conversions.Bson,options:org.mongodb.scala.model.UpdateOptions):org.mongodb.scala.SingleObservable[org.mongodb.scala.result.UpdateResult]" rel="noopener noreferrer"> <span> updateOne() </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="http://mongodb.github.io/mongo-scala-driver/2.9/scaladoc/org/mongodb/scala/MongoCollection.html#updateMany(filter:org.mongodb.scala.bson.conversions.Bson,update:org.mongodb.scala.bson.conversions.Bson,options:org.mongodb.scala.model.UpdateOptions):org.mongodb.scala.SingleObservable[org.mongodb.scala.result.UpdateResult]" rel="noopener noreferrer"> <span> updateMany() </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> , or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-scala-driver/2.9/scaladoc/org/mongodb/scala/MongoCollection.html#replaceOne(filter:org.mongodb.scala.bson.conversions.Bson,replacement:TResult,options:org.mongodb.scala.model.UpdateOptions):org.mongodb.scala.SingleObservable[org.mongodb.scala.result.UpdateResult]" rel="noopener noreferrer"> <span> replaceOne() </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> includes <code class="leafygreen-ui-1l06pbn"> upsert =&gt; true </code> <strong> and </strong> no documents match the specified filter, then the operation creates a new document and inserts it. If there are matching documents, then the operation modifies or replaces the matching document or documents. </p> <p class="leafygreen-ui-1kp3ins"> For details on the new document created, see the individual reference pages for the methods. </p> </div> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Write Acknowledgement <a class="headerlink leafygreen-ui-1kepx47" href="#write-acknowledgement" 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-acknowledgement"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> With write concerns, you can specify the level of acknowledgment requested from MongoDB for write operations. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/"> Write Concern <!-- --> . </a> </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-30"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_eu2amd42e" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_7hgkwhuyk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_81mviw2bw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_dp9oe1fxy" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_avszxp39p" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_yydfxnwsb" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_zug5ldrz6" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_797z61wbx" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_7rrq92dvf" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_mikoiub97" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_7jrpnf33j" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_eq665v4f5" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_su4eey1i3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ee42vlfjs" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Kotlin (Coroutine) </div> </button> <button aria-controls="_glxrj8i6w" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_wtwqm0i2t" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_3ic677a4d" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_thjs65jt9" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_7iy8j0lbl" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_j304rg032" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_6ttb4xhw2" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lkgqcc1m0" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_0xq4i0u3e" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_smcmnqz8m" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_t4kjipx1x" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_7dp0gc458" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_cjic3hqqt" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_vo56lry2q" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_stkvxu0r5" class="leafygreen-ui-38lglc" id="_mvvhz3sxp" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/update-documents-with-aggregation-pipeline/"> Updates with Aggregation Pipeline </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#mongodb-method-db.collection.updateOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.updateOne() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateMany/#mongodb-method-db.collection.updateMany"> <code class="leafygreen-ui-1l06pbn"> db.collection.updateMany() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.replaceOne/#mongodb-method-db.collection.replaceOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.replaceOne() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/update-methods/#std-label-additional-updates"> Additional Methods </a> </p> </li> </ul> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_trwzs8hlp" class="leafygreen-ui-38lglc" id="_6le83c579" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <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/compass/current/documents/" target="_self"> <span> Compass Documents </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/compass/current/query/filter/#std-label-compass-query-bar" target="_self"> <span> Compass Query Bar </span> </a> </p> </li> </ul> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_6sw87gdwk" class="leafygreen-ui-38lglc" id="_d438tww1n" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <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://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_UpdateOne.htm" rel="noopener noreferrer"> <span> IMongoCollection.UpdateOne() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_UpdateMany.htm" rel="noopener noreferrer"> <span> IMongoCollection.UpdateMany() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-csharp-driver/2.10/apidocs/html/M_MongoDB_Driver_IMongoCollection_1_ReplaceOne.htm" rel="noopener noreferrer"> <span> IMongoCollection.ReplaceOne() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/update-methods/#std-label-additional-updates"> Additional Methods </a> </p> </li> </ul> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_cu66wwszd" class="leafygreen-ui-38lglc" id="_19kyq3dpu" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <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://godoc.org/github.com/mongodb/mongo-go-driver/mongo#Collection.UpdateOne" rel="noopener noreferrer"> <span> Collection.UpdateOne </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://godoc.org/github.com/mongodb/mongo-go-driver/mongo#Collection.UpdateMany" rel="noopener noreferrer"> <span> Collection.UpdateMany </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://godoc.org/github.com/mongodb/mongo-go-driver/mongo#Collection.ReplaceOne" rel="noopener noreferrer"> <span> Collection.ReplaceOne </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/update-methods/#std-label-additional-updates"> Additional Methods </a> </p> </li> </ul> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_pfqu59erk" class="leafygreen-ui-38lglc" id="_mqt19jcti" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver-reactivestreams/1.6/javadoc/com/mongodb/reactivestreams/client/MongoCollection.html#updateOne(org.bson.conversions.Bson,%20org.bson.conversions.Bson)" rel="noopener noreferrer"> <span> com.mongodb.reactivestreams.client.MongoCollection.updateOne </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver-reactivestreams/1.6/javadoc/com/mongodb/reactivestreams/client/MongoCollection.html#updateMany(org.bson.conversions.Bson,%20org.bson.conversions.Bson)" rel="noopener noreferrer"> <span> com.mongodb.reactivestreams.client.MongoCollection.updateMany </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver-reactivestreams/1.6/javadoc/com/mongodb/reactivestreams/client/MongoCollection.html#replaceOne(org.bson.conversions.Bson,%20TDocument)" rel="noopener noreferrer"> <span> com.mongodb.reactivestreams.client.MongoCollection.replaceOne </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver-reactivestreams/1.6/getting-started/quick-tour/" rel="noopener noreferrer"> <span> Java Reactive Streams Driver Quick Tour </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> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_z49fmhzn8" class="leafygreen-ui-38lglc" id="_bo6hzh0k4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <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://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/MongoCollection.html#updateOne-org.bson.conversions.Bson-org.bson.conversions.Bson-" rel="noopener noreferrer"> <span> com.mongodb.client.MongoCollection.updateOne </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/MongoCollection.html#updateMany-org.bson.conversions.Bson-org.bson.conversions.Bson-" rel="noopener noreferrer"> <span> com.mongodb.client.MongoCollection.updateMany </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/3.4/javadoc/com/mongodb/client/MongoCollection.html#replaceOne-org.bson.conversions.Bson-TDocument-" rel="noopener noreferrer"> <span> com.mongodb.client.MongoCollection.replaceOne </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-java-driver/3.4/driver/tutorials/perform-write-operations/" rel="noopener noreferrer"> <span> Additional Java Synchronous Driver Write Examples </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> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_pns6prwqy" class="leafygreen-ui-38lglc" id="_5q9ho8kk7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <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://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-one.html" rel="noopener noreferrer"> <span> MongoCollection.updateOne() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-many.html" rel="noopener noreferrer"> <span> MongoCollection.updateMany() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://mongodb.github.io/mongo-java-driver/4.11/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/replace-one.html" rel="noopener noreferrer"> <span> MongoCollection.replaceOne() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/kotlin/coroutine/current/fundamentals/crud/write-operations/modify/" target="_self"> <span> Kotlin Coroutine Driver Modify Documents Guide </span> </a> </p> </li> </ul> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_d6lfxzw8b" class="leafygreen-ui-38lglc" id="_n1832k52d" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <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://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_collection.html#motor.motor_asyncio.AsyncIOMotorCollection.update_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> motor.motor_asyncio.AsyncIOMotorCollection.update_one </code> </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_collection.html#motor.motor_asyncio.AsyncIOMotorCollection.update_many" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> motor.motor_asyncio.AsyncIOMotorCollection.update_many </code> </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://motor.readthedocs.io/en/stable/api-asyncio/asyncio_motor_collection.html#motor.motor_asyncio.AsyncIOMotorCollection.replace_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> motor.motor_asyncio.AsyncIOMotorCollection.replace_one </code> </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/update-methods/#std-label-additional-updates"> Additional Methods </a> </p> </li> </ul> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_oe4wuohta" class="" id="_ue1bg6m0e" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#updateOne" rel="noopener noreferrer"> <span> Collection.updateOne() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#updateMany" rel="noopener noreferrer"> <span> Collection.updateMany() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#replaceOne" rel="noopener noreferrer"> <span> Collection.replaceOne() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/update-methods/#std-label-additional-updates"> Additional Methods </a> </p> </li> </ul> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_gcd7c3tmd" class="leafygreen-ui-38lglc" id="_slnn0l9p4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <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://metacpan.org/pod/MongoDB::Collection#update_one" rel="noopener noreferrer"> <span> MongoDB::Collection::update_one() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://metacpan.org/pod/MongoDB::Collection#update_many" rel="noopener noreferrer"> <span> MongoDB::Collection::update_many() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://metacpan.org/pod/MongoDB::Collection#replace_one" rel="noopener noreferrer"> <span> MongoDB::Collection::replace_one() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/update-methods/#std-label-additional-updates"> Additional Methods </a> </p> </li> </ul> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ly5iudo9l" class="leafygreen-ui-38lglc" id="_f41kc5ifi" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <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/php-library/upcoming/reference/method/MongoDBCollection-updateOne/#mongodb-phpmethod-phpmethod.MongoDB-Collection--updateOne--" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> MongoDB\\Collection::updateOne() </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/php-library/upcoming/reference/method/MongoDBCollection-updateMany/#mongodb-phpmethod-phpmethod.MongoDB-Collection--updateMany--" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> MongoDB\\Collection::updateMany() </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/php-library/upcoming/reference/method/MongoDBCollection-replaceOne/#mongodb-phpmethod-phpmethod.MongoDB-Collection--replaceOne--" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> MongoDB\\Collection::replaceOne() </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/update-methods/#std-label-additional-updates"> Additional Methods </a> </p> </li> </ul> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_7ysbyu29i" class="leafygreen-ui-38lglc" id="_zirmol9fl" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <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://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.update_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> pymongo.collection.Collection.update_one </code> </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.update_many" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> pymongo.collection.Collection.update_many </code> </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.replace_one" rel="noopener noreferrer"> <span> <code class="leafygreen-ui-1l06pbn"> pymongo.collection.Collection.replace_one </code> </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/update-methods/#std-label-additional-updates"> Additional Methods </a> </p> </li> </ul> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_4tlhuv0yp" class="leafygreen-ui-38lglc" id="_s2qqakp7l" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://api.mongodb.com/ruby/current/Mongo/Collection.html#update_one-instance_method" target="_self"> <span> Mongo::Collection#update_one() </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://api.mongodb.com/ruby/current/Mongo/Collection.html#update_many-instance_method" target="_self"> <span> Mongo::Collection#update_many() </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://api.mongodb.com/ruby/current/Mongo/Collection.html#replace_one-instance_method" target="_self"> <span> Mongo::Collection#replace_one() </span> </a> </p> </li> </ul> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_lfw87bbfj" class="leafygreen-ui-38lglc" id="_2bkr77oxh" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-scala-driver/2.9/scaladoc/org/mongodb/scala/MongoCollection.html#updateOne(filter:org.mongodb.scala.bson.conversions.Bson,update:org.mongodb.scala.bson.conversions.Bson,options:org.mongodb.scala.model.UpdateOptions):org.mongodb.scala.SingleObservable[org.mongodb.scala.result.UpdateResult]" rel="noopener noreferrer"> <span> collection.updateOne() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-scala-driver/2.9/scaladoc/org/mongodb/scala/MongoCollection.html#updateMany(filter:org.mongodb.scala.bson.conversions.Bson,update:org.mongodb.scala.bson.conversions.Bson,options:org.mongodb.scala.model.UpdateOptions):org.mongodb.scala.SingleObservable[org.mongodb.scala.result.UpdateResult]" rel="noopener noreferrer"> <span> collection.updateMany() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://mongodb.github.io/mongo-scala-driver/2.9/scaladoc/org/mongodb/scala/MongoCollection.html#replaceOne(filter:org.mongodb.scala.bson.conversions.Bson,replacement:TResult,options:org.mongodb.scala.model.UpdateOptions):org.mongodb.scala.SingleObservable[org.mongodb.scala.result.UpdateResult]" rel="noopener noreferrer"> <span> collection.replaceOne() </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/update-methods/#std-label-additional-updates"> Additional Methods </a> </p> </li> </ul> </div> </div> </div> </div> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/rank/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $rank (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-rank--aggregation-" 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="-rank--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <div> <p> <em> New <!-- --> in version <!-- --> 5.0 </em> . </p> </div> <dl class="group"> <dt> <code class="leafygreen-ui-1l06pbn"> $rank </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-group-grp.-rank" 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-group-grp.-rank"> </div> </a> </dt> <dd> </dd> </dl> <p class="leafygreen-ui-1kp3ins"> Returns the document position (known as the rank) relative to other documents in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-partitionBy"> partition <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-sortBy"> sortBy </a> field value in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage determines the document rank. When used with the <code class="leafygreen-ui-1l06pbn"> $rank </code> operator, <code class="leafygreen-ui-1l06pbn"> sortBy </code> can only take one field as its value. For more information on how MongoDB compares fields with different types, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-type-comparison-order/#std-label-bson-types-comparison-order"> BSON comparison order <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If multiple documents occupy the same rank, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-rank" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rank </code> </span> </a> places the document with the subsequent value at a rank with a gap (see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-rank-behavior" target="_self"> <span> Behavior </span> </a> ). </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-rank" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rank </code> </span> </a> is only available in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-rank" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rank </code> </span> </a> syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $rank: { } }"} </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">{ $rank: { } }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-rank" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rank </code> </span> </a> does not accept any parameters. </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/reference/operator/aggregation/denseRank/#mongodb-group-grp.-denseRank"> <code class="leafygreen-ui-1l06pbn"> $denseRank </code> </a> </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-rank-behavior"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-rank" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rank </code> </span> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/denseRank/#mongodb-group-grp.-denseRank"> <code class="leafygreen-ui-1l06pbn"> $denseRank </code> </a> differ in how they rank duplicate <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-sortBy"> sortBy </a> field values. For example, with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-sortBy"> sortBy </a> field values of 7, 9, 9, and 10: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/denseRank/#mongodb-group-grp.-denseRank"> <code class="leafygreen-ui-1l06pbn"> $denseRank </code> </a> ranks the values as 1, 2, 2, and 3. The duplicate 9 values have a rank of 2, and 10 has a rank of 3. There is no gap in the ranks. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-rank" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rank </code> </span> </a> ranks the values as 1, 2, 2, and 4. The duplicate 9 values have a rank of 2, and 10 has a rank of 4. There is a gap in the ranks for 3. </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Documents with a <code class="leafygreen-ui-1l06pbn"> null </code> value for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-sortBy"> sortBy </a> field or documents missing the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-sortBy"> sortBy </a> field are assigned a rank based on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-type-comparison-order/#std-label-bson-types-comparison-order"> BSON comparison order </a> . See the example in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-rank-duplicate-null-missing-values-example" target="_self"> <span> Rank Partitions Containing Duplicate Values, Nulls, or Missing Data <!-- --> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, <code class="leafygreen-ui-1l06pbn"> null </code> and missing field values in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/denseRank/#mongodb-group-grp.-denseRank"> <code class="leafygreen-ui-1l06pbn"> $denseRank </code> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-rank" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rank </code> </span> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-sortBy"> sortBy </a> operations are treated the same when calculating rankings. This change makes the behavior of <code class="leafygreen-ui-1l06pbn"> denseRank </code> and <code class="leafygreen-ui-1l06pbn"> rank </code> consistent with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sort/#mongodb-pipeline-pipe.-sort"> <code class="leafygreen-ui-1l06pbn"> $sort </code> . </a> </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Create a <code class="leafygreen-ui-1l06pbn"> cakeSales </code> collection that contains cake sales in the states of California ( <code class="leafygreen-ui-1l06pbn"> CA </code> ) and Washington ( <code class="leafygreen-ui-1l06pbn"> WA </code> ): </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.insertMany( [\n { _id: 0, type: \"chocolate\", orderDate: new Date(\"2020-05-18T14:10:30Z\"),\n state: \"CA\", price: 13, quantity: 120 },\n { _id: 1, type: \"chocolate\", orderDate: new Date(\"2021-03-20T11:30:05Z\"),\n state: \"WA\", price: 14, quantity: 140 },\n { _id: 2, type: \"vanilla\", orderDate: new Date(\"2021-01-11T06:31:15Z\"),\n state: \"CA\", price: 12, quantity: 145 },\n { _id: 3, type: \"vanilla\", orderDate: new Date(\"2020-02-08T13:13:23Z\"),\n state: \"WA\", price: 13, quantity: 104 },\n { _id: 4, type: \"strawberry\", orderDate: new Date(\"2019-05-18T16:09:01Z\"),\n state: \"CA\", price: 41, quantity: 162 },\n { _id: 5, type: \"strawberry\", orderDate: new Date(\"2019-01-08T06:12:03Z\"),\n state: \"WA\", price: 43, quantity: 134 }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">120</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">140</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">145</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">104</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">162</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">134</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Rank Partitions by an Integer Field <a class="headerlink leafygreen-ui-1kepx47" href="#rank-partitions-by-an-integer-field" 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="rank-partitions-by-an-integer-field"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> This example uses <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-rank" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rank </code> </span> </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage to output the <code class="leafygreen-ui-1l06pbn"> quantity </code> rank of the cake sales for each <code class="leafygreen-ui-1l06pbn"> state </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.aggregate( [\n {\n $setWindowFields: {\n partitionBy: \"$state\",\n sortBy: { quantity: -1 },\n output: {\n rankQuantityForState: {\n $rank: {}\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <span class="lg-highlight-string">"$state"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">quantity</span>: <!-- -->-<span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">rankQuantityForState</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$rank</span>: <!-- -->{<!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> partitionBy: "$state" </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-partitionBy"> partitions </a> the documents in the collection by <code class="leafygreen-ui-1l06pbn"> state </code> . There are partitions for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sortBy: { quantity: -1 } </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-sortBy"> sorts </a> the documents in each partition by <code class="leafygreen-ui-1l06pbn"> quantity </code> in descending order ( <code class="leafygreen-ui-1l06pbn"> -1 </code> ), so the highest <code class="leafygreen-ui-1l06pbn"> quantity </code> is first. </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> output </code> sets the <code class="leafygreen-ui-1l06pbn"> rankQuantityForState </code> field to the <code class="leafygreen-ui-1l06pbn"> quantity </code> rank using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-rank" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rank </code> </span> </a> , as shown in the following results. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 4, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-05-18T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 41, \"quantity\" : 162, \"rankQuantityForState\" : 1 }\n{ \"_id\" : 2, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2021-01-11T06:31:15Z\"),\n \"state\" : \"CA\", \"price\" : 12, \"quantity\" : 145, \"rankQuantityForState\" : 2 }\n{ \"_id\" : 0, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2020-05-18T14:10:30Z\"),\n \"state\" : \"CA\", \"price\" : 13, \"quantity\" : 120, \"rankQuantityForState\" : 3 }\n{ \"_id\" : 1, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2021-03-20T11:30:05Z\"),\n \"state\" : \"WA\", \"price\" : 14, \"quantity\" : 140, \"rankQuantityForState\" : 1 }\n{ \"_id\" : 5, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 43, \"quantity\" : 134, \"rankQuantityForState\" : 2 }\n{ \"_id\" : 3, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2020-02-08T13:13:23Z\"),\n \"state\" : \"WA\", \"price\" : 13, \"quantity\" : 104, \"rankQuantityForState\" : 3 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">145</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">2</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">120</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">3</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">140</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">2</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">104</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">3</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Rank Partitions by a Date Field <a class="headerlink leafygreen-ui-1kepx47" href="#rank-partitions-by-a-date-field" 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="rank-partitions-by-a-date-field"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> This example shows how to use dates with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-rank" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rank </code> </span> </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage to output the <code class="leafygreen-ui-1l06pbn"> orderDate </code> rank of the cake sales for each <code class="leafygreen-ui-1l06pbn"> state </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.aggregate( [\n {\n $setWindowFields: {\n partitionBy: \"$state\",\n sortBy: { orderDate: 1 },\n output: {\n rankOrderDateForState: {\n $rank: {}\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <span class="lg-highlight-string">"$state"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">rankOrderDateForState</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$rank</span>: <!-- -->{<!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> partitionBy: "$state" </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-partitionBy"> partitions </a> the documents in the collection by <code class="leafygreen-ui-1l06pbn"> state </code> . There are partitions for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sortBy: { orderDate: 1 } </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-sortBy"> sorts </a> the documents in each partition by <code class="leafygreen-ui-1l06pbn"> orderDate </code> in ascending order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ), so the earliest <code class="leafygreen-ui-1l06pbn"> orderDate </code> is first. </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> output </code> sets the <code class="leafygreen-ui-1l06pbn"> rankOrderDateForState </code> field to the <code class="leafygreen-ui-1l06pbn"> orderDate </code> rank using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-rank" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rank </code> </span> </a> , as shown in the following results. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 4, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-05-18T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 41, \"quantity\" : 162, \"rankOrderDateForState\" : 1 }\n{ \"_id\" : 0, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2020-05-18T14:10:30Z\"),\n \"state\" : \"CA\", \"price\" : 13, \"quantity\" : 120, \"rankOrderDateForState\" : 2 }\n{ \"_id\" : 2, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2021-01-11T06:31:15Z\"),\n \"state\" : \"CA\", \"price\" : 12, \"quantity\" : 145, \"rankOrderDateForState\" : 3 }\n{ \"_id\" : 5, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 43, \"quantity\" : 134, \"rankOrderDateForState\" : 1 }\n{ \"_id\" : 3, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2020-02-08T13:13:23Z\"),\n \"state\" : \"WA\", \"price\" : 13, \"quantity\" : 104, \"rankOrderDateForState\" : 2 }\n{ \"_id\" : 1, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2021-03-20T11:30:05Z\"),\n \"state\" : \"WA\", \"price\" : 14, \"quantity\" : 140, \"rankOrderDateForState\" : 3 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>, <span class="lg-highlight-string">"rankOrderDateForState"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">120</span>, <span class="lg-highlight-string">"rankOrderDateForState"</span> <!-- -->: <span class="lg-highlight-number">2</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">145</span>, <span class="lg-highlight-string">"rankOrderDateForState"</span> <!-- -->: <span class="lg-highlight-number">3</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"rankOrderDateForState"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">104</span>, <span class="lg-highlight-string">"rankOrderDateForState"</span> <!-- -->: <span class="lg-highlight-number">2</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">140</span>, <span class="lg-highlight-string">"rankOrderDateForState"</span> <!-- -->: <span class="lg-highlight-number">3</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-rank-duplicate-null-missing-values-example"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Rank Partitions Containing Duplicate Values, Nulls, or Missing Data <a class="headerlink leafygreen-ui-1kepx47" href="#rank-partitions-containing-duplicate-values--nulls--or-missing-data" 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="rank-partitions-containing-duplicate-values--nulls--or-missing-data"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Create a <code class="leafygreen-ui-1l06pbn"> cakeSalesWithDuplicates </code> collection where: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Cake sales are placed in the state of California ( <code class="leafygreen-ui-1l06pbn"> CA </code> ) and Washington ( <code class="leafygreen-ui-1l06pbn"> WA </code> ). </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Documents 6 to 8 have the same <code class="leafygreen-ui-1l06pbn"> quantity </code> and <code class="leafygreen-ui-1l06pbn"> state </code> as document 5. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Document 9 has the same <code class="leafygreen-ui-1l06pbn"> quantity </code> and <code class="leafygreen-ui-1l06pbn"> state </code> as document 4. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Document 10 has a <code class="leafygreen-ui-1l06pbn"> null </code> <code class="leafygreen-ui-1l06pbn"> quantity </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Document 11 is missing the <code class="leafygreen-ui-1l06pbn"> quantity </code> . </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSalesWithDuplicates.insertMany( [\n { _id: 0, type: \"chocolate\", orderDate: new Date(\"2020-05-18T14:10:30Z\"),\n state: \"CA\", price: 13, quantity: 120 },\n { _id: 1, type: \"chocolate\", orderDate: new Date(\"2021-03-20T11:30:05Z\"),\n state: \"WA\", price: 14, quantity: 140 },\n { _id: 2, type: \"vanilla\", orderDate: new Date(\"2021-01-11T06:31:15Z\"),\n state: \"CA\", price: 12, quantity: 145 },\n { _id: 3, type: \"vanilla\", orderDate: new Date(\"2020-02-08T13:13:23Z\"),\n state: \"WA\", price: 13, quantity: 104 },\n { _id: 4, type: \"strawberry\", orderDate: new Date(\"2019-05-18T16:09:01Z\"),\n state: \"CA\", price: 41, quantity: 162 },\n { _id: 5, type: \"strawberry\", orderDate: new Date(\"2019-01-08T06:12:03Z\"),\n state: \"WA\", price: 43, quantity: 134 },\n { _id: 6, type: \"strawberry\", orderDate: new Date(\"2020-01-08T06:12:03Z\"),\n state: \"WA\", price: 41, quantity: 134 },\n { _id: 7, type: \"strawberry\", orderDate: new Date(\"2020-01-01T06:12:03Z\"),\n state: \"WA\", price: 34, quantity: 134 },\n { _id: 8, type: \"strawberry\", orderDate: new Date(\"2020-01-02T06:12:03Z\"),\n state: \"WA\", price: 40, quantity: 134 },\n { _id: 9, type: \"strawberry\", orderDate: new Date(\"2020-05-11T16:09:01Z\"),\n state: \"CA\", price: 39, quantity: 162 },\n { _id: 10, type: \"strawberry\", orderDate: new Date(\"2020-05-11T16:09:01Z\"),\n state: \"CA\", price: 39, quantity: null },\n { _id: 11, type: \"strawberry\", orderDate: new Date(\"2020-05-11T16:09:01Z\"),\n state: \"CA\", price: 39 }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSalesWithDuplicates</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">120</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">140</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">145</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">104</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">162</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">134</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">134</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">7</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-01-01T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">34</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">134</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">8</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-01-02T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">40</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">134</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">9</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-05-11T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">39</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">162</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-05-11T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">39</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-literal">null</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-05-11T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">39</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This example uses <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-rank" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rank </code> </span> </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage to output the <code class="leafygreen-ui-1l06pbn"> quantity </code> rank from the <code class="leafygreen-ui-1l06pbn"> cakeSalesWithDuplicates </code> collection for each <code class="leafygreen-ui-1l06pbn"> state </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSalesWithDuplicates.aggregate( [\n {\n $setWindowFields: {\n partitionBy: \"$state\",\n sortBy: { quantity: -1 },\n output: {\n rankQuantityForState: {\n $rank: {}\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSalesWithDuplicates</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <span class="lg-highlight-string">"$state"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">quantity</span>: <!-- -->-<span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">rankQuantityForState</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$rank</span>: <!-- -->{<!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> partitionBy: "$state" </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-partitionBy"> partitions </a> the documents in the collection by <code class="leafygreen-ui-1l06pbn"> state </code> . There are partitions for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sortBy: { quantity: -1 } </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-sortBy"> sorts </a> the documents in each partition by <code class="leafygreen-ui-1l06pbn"> quantity </code> in descending order ( <code class="leafygreen-ui-1l06pbn"> -1 </code> ), so the highest <code class="leafygreen-ui-1l06pbn"> quantity </code> is first. </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> output </code> sets the <code class="leafygreen-ui-1l06pbn"> rankOrderDateForState </code> field to the <code class="leafygreen-ui-1l06pbn"> quantity </code> rank using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-rank" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rank </code> . </span> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> In the following example output: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Documents with the same <code class="leafygreen-ui-1l06pbn"> quantity </code> and <code class="leafygreen-ui-1l06pbn"> state </code> have the same rank. If documents have the same rank, there is a gap between that rank and the next rank. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The document with the <code class="leafygreen-ui-1l06pbn"> null </code> <code class="leafygreen-ui-1l06pbn"> quantity </code> and then the document with the missing <code class="leafygreen-ui-1l06pbn"> quantity </code> are ranked the lowest in the output for the <code class="leafygreen-ui-1l06pbn"> CA </code> partition. This sorting is the result of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-type-comparison-order/#std-label-bson-types-comparison-order"> BSON comparison order </a> , which sorts <code class="leafygreen-ui-1l06pbn"> null </code> and missing values after number values in this example. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 4, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-05-18T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 41, \"quantity\" : 162, \"rankQuantityForState\" : 1 }\n{ \"_id\" : 9, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2020-05-11T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 39, \"quantity\" : 162, \"rankQuantityForState\" : 1 }\n{ \"_id\" : 2, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2021-01-11T06:31:15Z\"),\n \"state\" : \"CA\", \"price\" : 12, \"quantity\" : 145, \"rankQuantityForState\" : 3 }\n{ \"_id\" : 0, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2020-05-18T14:10:30Z\"),\n \"state\" : \"CA\", \"price\" : 13, \"quantity\" : 120, \"rankQuantityForState\" : 4 }\n{ \"_id\" : 10, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2020-05-11T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 39, \"quantity\" : null, \"rankQuantityForState\" : 5 }\n{ \"_id\" : 11, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2020-05-11T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 39, \"rankQuantityForState\" : 5 }\n{ \"_id\" : 1, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2021-03-20T11:30:05Z\"),\n \"state\" : \"WA\", \"price\" : 14, \"quantity\" : 140, \"rankQuantityForState\" : 1 }\n{ \"_id\" : 5, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 43, \"quantity\" : 134, \"rankQuantityForState\" : 2 }\n{ \"_id\" : 6, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2020-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 41, \"quantity\" : 134, \"rankQuantityForState\" : 2 }\n{ \"_id\" : 7, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2020-01-01T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 34, \"quantity\" : 134, \"rankQuantityForState\" : 2 }\n{ \"_id\" : 8, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2020-01-02T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 40, \"quantity\" : 134, \"rankQuantityForState\" : 2 }\n{ \"_id\" : 3, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2020-02-08T13:13:23Z\"),\n \"state\" : \"WA\", \"price\" : 13, \"quantity\" : 104, \"rankQuantityForState\" : 6 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">9</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-11T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">39</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">145</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">3</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">120</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">4</span> }</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-11T16:09:01Z"</span>)<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">39</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-literal">null</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">5</span> }</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-11T16:09:01Z"</span>)<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">39</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">5</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">140</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">2</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">2</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">7</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-01-01T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">34</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">2</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">8</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-01-02T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">40</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">2</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">104</span>, <span class="lg-highlight-string">"rankQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">6</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/manage-shard-zone/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Manage Shard Zones <a class="headerlink leafygreen-ui-1kepx47" href="#manage-shard-zones" 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="manage-shard-zones"> </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="#add-shards-to-a-zone" target="_self"> <span> Add Shards to a Zone </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#create-a-zone-range" target="_self"> <span> Create a Zone Range </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#remove-a-zone-range" target="_self"> <span> Remove a Zone Range </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#view-existing-zones" target="_self"> <span> View Existing Zones </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> In sharded clusters, you can create zones that represent a group of shards and associate one or more ranges of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key"> shard key </a> values to that zone. MongoDB routes reads and writes that fall into a zone range only to those shards inside of the zone. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> By defining the zones and the zone ranges <em> before </em> sharding an empty or a non-existing collection, the shard collection operation creates chunks for the defined zone ranges as well as any additional chunks to cover the entire range of the shard key values and performs an initial chunk distribution based on the zone ranges. This initial creation and distribution of chunks allows for faster setup of zoned sharding. After the initial distribution, the balancer manages the chunk distribution going forward. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.updateZoneKeyRange/#std-label-pre-define-zone-range-example"> Pre-Define Zones and Zone Ranges for an Empty or Non-Existing Collection </a> for an example. </p> </div> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Add Shards to a Zone <a class="headerlink leafygreen-ui-1kepx47" href="#add-shards-to-a-zone" 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="add-shards-to-a-zone"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Associate a Zone with a particular shard using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.addShardToZone/#mongodb-method-sh.addShardToZone"> <code class="leafygreen-ui-1l06pbn"> sh.addShardToZone() </code> </a> method when connected to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance. A single shard may have multiple zones, and multiple shards may also have the same zone. </p> <div class="leafygreen-ui-vg7qwp" role="note"> <h2 class="leafygreen-ui-2xicti"> Example </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The following example adds the zone <code class="leafygreen-ui-1l06pbn"> NYC </code> to two shards, and the zones <code class="leafygreen-ui-1l06pbn"> SFO </code> and <code class="leafygreen-ui-1l06pbn"> NRT </code> to a third shard: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.addShardToZone(\"shard0000\", \"NYC\")\nsh.addShardToZone(\"shard0001\", \"NYC\")\nsh.addShardToZone(\"shard0002\", \"SFO\")\nsh.addShardToZone(\"shard0002\", \"NRT\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShardToZone</span>(<span class="lg-highlight-string">"shard0000"</span>, <span class="lg-highlight-string">"NYC"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShardToZone</span>(<span class="lg-highlight-string">"shard0001"</span>, <span class="lg-highlight-string">"NYC"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShardToZone</span>(<span class="lg-highlight-string">"shard0002"</span>, <span class="lg-highlight-string">"SFO"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShardToZone</span>(<span class="lg-highlight-string">"shard0002"</span>, <span class="lg-highlight-string">"NRT"</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> </div> <p class="leafygreen-ui-1kp3ins"> You may remove zone from a particular shard using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.removeShardFromZone/#mongodb-method-sh.removeShardFromZone"> <code class="leafygreen-ui-1l06pbn"> sh.removeShardFromZone() </code> </a> method when connected to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance, as in the following example, which removes the <code class="leafygreen-ui-1l06pbn"> NRT </code> zone from a shard: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.removeShardFromZone(\"shard0002\", \"NRT\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">removeShardFromZone</span>(<span class="lg-highlight-string">"shard0002"</span>, <span class="lg-highlight-string">"NRT"</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> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Create a Zone Range <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-zone-range" 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-zone-range"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To define the zone's range of shard keys, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.updateZoneKeyRange/#mongodb-method-sh.updateZoneKeyRange"> <code class="leafygreen-ui-1l06pbn"> sh.updateZoneKeyRange() </code> </a> method when connected to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance. Any given shard key range may only have <em> one </em> assigned zone. You cannot overlap defined ranges. </p> <div class="leafygreen-ui-vg7qwp" role="note"> <h2 class="leafygreen-ui-2xicti"> Example </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Given a collection named <code class="leafygreen-ui-1l06pbn"> users </code> in the <code class="leafygreen-ui-1l06pbn"> records </code> database, sharded by the <code class="leafygreen-ui-1l06pbn"> zipcode </code> field. The following operations assign: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> two ranges of zip codes in Manhattan and Brooklyn the <code class="leafygreen-ui-1l06pbn"> NYC </code> zone </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> one range of zip codes in San Francisco the <code class="leafygreen-ui-1l06pbn"> SFO </code> zone </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.updateZoneKeyRange(\"records.users\", { zipcode: \"10001\" }, { zipcode: \"10281\" }, \"NYC\")\nsh.updateZoneKeyRange(\"records.users\", { zipcode: \"11201\" }, { zipcode: \"11240\" }, \"NYC\")\nsh.updateZoneKeyRange(\"records.users\", { zipcode: \"94102\" }, { zipcode: \"94135\" }, \"SFO\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">updateZoneKeyRange</span>(<span class="lg-highlight-string">"records.users"</span>, <!-- -->{ <span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"10001"</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"10281"</span> }<!-- -->, <span class="lg-highlight-string">"NYC"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">updateZoneKeyRange</span>(<span class="lg-highlight-string">"records.users"</span>, <!-- -->{ <span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"11201"</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"11240"</span> }<!-- -->, <span class="lg-highlight-string">"NYC"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">updateZoneKeyRange</span>(<span class="lg-highlight-string">"records.users"</span>, <!-- -->{ <span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"94102"</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"94135"</span> }<!-- -->, <span class="lg-highlight-string">"SFO"</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> </div> <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"> Zone ranges are always inclusive of the lower boundary and exclusive of the upper boundary. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Dropping a collection deletes its associated zone/tag ranges. </p> </li> </ul> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Remove a Zone Range <a class="headerlink leafygreen-ui-1kepx47" href="#remove-a-zone-range" 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="remove-a-zone-range"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Use the shell helper method <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.removeRangeFromZone/#mongodb-method-sh.removeRangeFromZone"> <code class="leafygreen-ui-1l06pbn"> sh.removeRangeFromZone() </code> </a> to remove a range from a zone. </p> <div class="leafygreen-ui-vg7qwp" role="note"> <h2 class="leafygreen-ui-2xicti"> Example </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The following example removes the <code class="leafygreen-ui-1l06pbn"> NYC </code> zone assignment for the range of zip codes within Manhattan: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.removeRangeFromZone(\"records.user\", {zipcode: \"10001\"}, {zipcode: \"10281\"})","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">sh.<span class="lg-highlight-title lg-highlight-function">removeRangeFromZone</span>(<span class="lg-highlight-string">"records.user"</span>, <!-- -->{<span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"10001"</span>}<!-- -->, <!-- -->{<span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"10281"</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> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Dropping a collection deletes its associated zone/tag ranges. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> View Existing Zones <a class="headerlink leafygreen-ui-1kepx47" href="#view-existing-zones" 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="view-existing-zones"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.status/#mongodb-method-sh.status"> <code class="leafygreen-ui-1l06pbn"> sh.status() </code> </a> to list the zones associated to each shard in the cluster. You can also view a shards zones by querying the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/config-database/#mongodb-data-config.shards"> <code class="leafygreen-ui-1l06pbn"> shards </code> </a> collection in the <code class="leafygreen-ui-1l06pbn"> config </code> database. </p> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find() </code> </a> method to return all shards with the <code class="leafygreen-ui-1l06pbn"> NYC </code> zone. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use config\ndb.shards.find({ tags: \"NYC\" })","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use config</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">shards</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->{ <span class="lg-highlight-attr">tags</span>: <span class="lg-highlight-string">"NYC"</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"> You can find zone ranges for all <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-namespace"> namespaces </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/config-database/#mongodb-data-config.tags"> <code class="leafygreen-ui-1l06pbn"> tags </code> </a> collection of the <code class="leafygreen-ui-1l06pbn"> config </code> database. The output of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.status/#mongodb-method-sh.status"> <code class="leafygreen-ui-1l06pbn"> sh.status() </code> </a> also displays all zone ranges. </p> <p class="leafygreen-ui-1kp3ins"> The following example uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find() </code> </a> method to return any range associated to the <code class="leafygreen-ui-1l06pbn"> NYC </code> zone. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use config\ndb.tags.find({ tag: \"NYC\" })","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use config</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">tags</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->{ <span class="lg-highlight-attr">tag</span>: <span class="lg-highlight-string">"NYC"</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> </section> </section>
https://www.mongodb.com/docs/manual/core/security-in-use-encryption/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> In-Use Encryption <a class="headerlink leafygreen-ui-1kepx47" href="#in-use-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="in-use-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="#choosing-an-in-use-encryption-approach" target="_self"> <span> Choosing an In-Use Encryption Approach </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#encryption-keys-and-key-vaults" target="_self"> <span> Encryption Keys and Key Vaults </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#queryable-encryption" target="_self"> <span> Queryable Encryption </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#client-side-field-level-encryption" target="_self"> <span> Client-Side Field Level Encryption </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB provides two approaches to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-In-Use-Encryption"> In-Use Encryption <!-- --> : </a> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/#std-label-qe-manual-feature-qe"> Queryable Encryption </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/#std-label-manual-csfle-feature"> Client-Side Field Level Encryption <!-- --> . </a> </p> </li> </ul> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Choosing an In-Use Encryption Approach <a class="headerlink leafygreen-ui-1kepx47" href="#choosing-an-in-use-encryption-approach" 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="choosing-an-in-use-encryption-approach"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can use both Queryable Encryption and Client-Side Field Level Encryption in the same deployment, but they are incompatible with each other in the same collection. For a comparison of the two, including compatibility with MongoDB versions and points to consider when choosing one or the other, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/about-qe-csfle/#std-label-about-qe-csfle"> Choosing an In-Use Encryption Approach <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Encryption Keys and Key Vaults <a class="headerlink leafygreen-ui-1kepx47" href="#encryption-keys-and-key-vaults" 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="encryption-keys-and-key-vaults"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Both Queryable Encryption and Client-Side Field Level Encryption use an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-envelope-encryption"> envelope encryption </a> approach to encrypt data, where an encrypted field in a document uses a unique <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-Data-Encryption-Key"> Data Encryption Key </a> , and those keys are encrypted using a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-Customer-Master-Key"> Customer Master Key <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> For details, 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> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Queryable Encryption <a class="headerlink leafygreen-ui-1kepx47" href="#queryable-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="queryable-encryption"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To learn how Queryable Encryption and its components work and how to implement it in your application, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/#std-label-qe-manual-feature-qe"> Queryable Encryption <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Client-Side Field Level Encryption <a class="headerlink leafygreen-ui-1kepx47" href="#client-side-field-level-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="client-side-field-level-encryption"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To learn how Client-Side Field Level Encryption and its components work and how to implement it in your application, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/#std-label-manual-csfle-feature"> Client-Side Field Level Encryption <!-- --> . </a> </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/compact/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> compact <a class="headerlink leafygreen-ui-1kepx47" href="#compact" 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="compact"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#command-fields" target="_self"> <span> Command Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compact-required-privileges" target="_self"> <span> <code class="css-1kekw28 e1wawog0"> compact </code> Required Privileges </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </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"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> compact </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.compact" 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-dbcommand-dbcmd.compact"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Attempts to release unneeded disk space to the operating system. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <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 command is not supported in M0, M2, and M5 clusters. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand(\n {\n compact: &lt;string&gt;,\n dryRun: &lt;boolean&gt;,\n force: &lt;boolean&gt;, // Optional\n freeSpaceTargetMB: &lt;int&gt;, // Optional\n comment: &lt;any&gt;, // Optional\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">compact</span>: &lt;<!-- -->string<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dryRun</span>: &lt;<!-- -->boolean<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">force</span>: &lt;<!-- -->boolean<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-comment">// Optional</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">freeSpaceTargetMB</span>: &lt;<!-- -->int<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-comment">// Optional</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">comment</span>: &lt;<!-- -->any<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-comment">// Optional</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Command Fields <a class="headerlink leafygreen-ui-1kepx47" href="#command-fields" 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="command-fields"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command takes the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> compact </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The name of the collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> dryRun </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div> <p> <em> New <!-- --> in version <!-- --> 8.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> If enabled, the <code class="leafygreen-ui-1l06pbn"> compact </code> command returns an estimate of how much space, in bytes, compaction can reclaim from the targeted collection. If you run <code class="leafygreen-ui-1l06pbn"> compact </code> with <code class="leafygreen-ui-1l06pbn"> dryRun </code> set to <code class="leafygreen-ui-1l06pbn"> true </code> , MongoDB only returns the estimated value and does not perform any kind of compaction. </p> <p class="leafygreen-ui-1kp3ins"> <em> Default: </em> False </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> force </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div> <p> <em> Changed <!-- --> in version <!-- --> 4.4 </em> . </p> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-compact-force-option"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. If enabled, forces <code class="leafygreen-ui-1l06pbn"> compact </code> to run on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> . <code class="leafygreen-ui-1l06pbn"> compact </code> does not block <a class="leafygreen-ui-tqgtui" href="/docs/manual/crud/#std-label-crud"> MongoDB CRUD Operations </a> on the database it is compacting. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> freeSpaceTargetMB </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Specifies the minimum amount of storage space, in megabytes, that must be recoverable for compaction to proceed. </p> <p class="leafygreen-ui-1kp3ins"> <em> Default: </em> 20 </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> comment </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> any </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. A user-provided comment to attach to this command. Once set, this comment appears alongside records of this command in the following locations: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-messages-ref"> mongod log messages </a> , in the <code class="leafygreen-ui-1l06pbn"> attr.command.cursor.comment </code> field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/database-profiler/#std-label-profiler"> Database profiler </a> output, in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/database-profiler/#mongodb-data-system.profile.command"> <code class="leafygreen-ui-1l06pbn"> command.comment </code> </a> field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-dbcommand-dbcmd.currentOp"> <code class="leafygreen-ui-1l06pbn"> currentOp </code> </a> output, in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-data-currentOp.command"> <code class="leafygreen-ui-1l06pbn"> command.comment </code> </a> field. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> A comment can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-bson-types"> BSON type </a> (string, integer, object, array, etc). </p> </div> </div> </td> </tr> </tbody> </table> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-compact-authentication"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> <code class="leafygreen-ui-1l06pbn"> compact </code> Required Privileges <a class="headerlink leafygreen-ui-1kepx47" href="#compact-required-privileges" 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="compact-required-privileges"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> For clusters enforcing <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-authentication"> authentication </a> , you must authenticate as a user with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-compact"> <code class="leafygreen-ui-1l06pbn"> compact </code> </a> privilege action on the target collection. The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-dbAdmin"> <code class="leafygreen-ui-1l06pbn"> dbAdmin </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-hostManager"> <code class="leafygreen-ui-1l06pbn"> hostManager </code> </a> roles provide the required privileges for running <code class="leafygreen-ui-1l06pbn"> compact </code> against non-system collections. </p> <p class="leafygreen-ui-1kp3ins"> For <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#std-label-metadata-system-collections"> system collections </a> , you must: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create a custom role that grants the <code class="leafygreen-ui-1l06pbn"> compact </code> action on the system collection. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Grant that role to a new or existing user. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Authenticate as that user to perform the <code class="leafygreen-ui-1l06pbn"> compact </code> command. </p> </li> </ol> <p class="leafygreen-ui-1kp3ins"> For example, the following operations create a custom role that grants the <code class="leafygreen-ui-1l06pbn"> compact </code> action against the specified database and collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use admin\ndb.createRole(\n {\n role: \"myCustomCompactRole\",\n privileges: [\n {\n resource: { \"db\" : \"&lt;database&gt;\" , \"collection\" : \"&lt;collection&gt;\" },\n actions: [ \"compact\" ]\n }\n ],\n roles: []\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use admin</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createRole</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"myCustomCompactRole"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">privileges</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">resource</span>: <!-- -->{ <span class="lg-highlight-string">"db"</span> <!-- -->: <span class="lg-highlight-string">"&lt;database&gt;"</span> <!-- -->, <span class="lg-highlight-string">"collection"</span> <!-- -->: <span class="lg-highlight-string">"&lt;collection&gt;"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">actions</span>: <!-- -->[ <span class="lg-highlight-string">"compact"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>: <!-- -->[<!-- -->]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on configuring the <code class="leafygreen-ui-1l06pbn"> resource </code> document, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/resource-document/#std-label-resource-document"> Resource Document on Self-Managed Deployments <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To add the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-dbAdmin"> <code class="leafygreen-ui-1l06pbn"> dbAdmin </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-hostManager"> <code class="leafygreen-ui-1l06pbn"> hostManager </code> </a> , or the custom role to an existing user, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.grantRolesToUser/#mongodb-method-db.grantRolesToUser"> <code class="leafygreen-ui-1l06pbn"> db.grantRolesToUser() </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.updateUser/#mongodb-method-db.updateUser"> <code class="leafygreen-ui-1l06pbn"> db.updateUser() </code> </a> . The following operation grants the custom <code class="leafygreen-ui-1l06pbn"> compact </code> role to the <code class="leafygreen-ui-1l06pbn"> myCompactUser </code> on the <code class="leafygreen-ui-1l06pbn"> admin </code> database: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use admin\ndb.grantRolesToUser(\"myCompactUser\", [ \"dbAdmin\" | \"myCustomCompactRole\" ] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use admin</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">grantRolesToUser</span>(<span class="lg-highlight-string">"myCompactUser"</span>, <!-- -->[ <span class="lg-highlight-string">"dbAdmin"</span> <!-- -->| <span class="lg-highlight-string">"myCustomCompactRole"</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"> To add the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-dbAdmin"> <code class="leafygreen-ui-1l06pbn"> dbAdmin </code> </a> or the custom role to a new user, specify the role to the <code class="leafygreen-ui-1l06pbn"> roles </code> array of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createUser/#mongodb-method-db.createUser"> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </a> method when creating the user. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use admin\ndb.createUser(\n {\n user: \"myCompactUser\",\n pwd: \"myCompactUserPassword\",\n roles: [\n { role: \"dbAdmin\", db: \"&lt;database&gt;\" } | \"myCustomCompactRole\"\n ]\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use admin</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createUser</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">user</span>: <span class="lg-highlight-string">"myCompactUser"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pwd</span>: <span class="lg-highlight-string">"myCompactUserPassword"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"dbAdmin"</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"&lt;database&gt;"</span> } <!-- -->| <span class="lg-highlight-string">"myCustomCompactRole"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Monitoring Progress <a class="headerlink leafygreen-ui-1kepx47" href="#monitoring-progress" 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="monitoring-progress"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To check the <code class="leafygreen-ui-1l06pbn"> compact </code> operation's progress, monitor the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> log file or run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.currentOp/#mongodb-method-db.currentOp"> <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> </a> from another shell instance. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Operation Termination <a class="headerlink leafygreen-ui-1kepx47" href="#operation-termination" 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="operation-termination"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you terminate <code class="leafygreen-ui-1l06pbn"> compact </code> with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.killOp/#mongodb-method-db.killOp"> <code class="leafygreen-ui-1l06pbn"> db.killOp() </code> </a> method or restart the server before the operation finishes, <code class="leafygreen-ui-1l06pbn"> compact </code> ends and may fail its attempt to release disk space back to the operating system. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Disk Space <a class="headerlink leafygreen-ui-1kepx47" href="#disk-space" 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="disk-space"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To see how the storage space changes for the collection, run the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collStats/#mongodb-dbcommand-dbcmd.collStats"> <code class="leafygreen-ui-1l06pbn"> collStats </code> </a> command before and after compaction. </p> <p class="leafygreen-ui-1kp3ins"> On <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/wiredtiger/#std-label-storage-wiredtiger"> WiredTiger </a> , <code class="leafygreen-ui-1l06pbn"> compact </code> attempts to reduce the required storage space for data and indexes in a collection, releasing unneeded disk space to the operating system. The effectiveness of this operation is workload dependent and no disk space may be recovered. This command is useful if you have removed a large amount of data from the collection, and do not plan to replace it. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> compact </code> may require additional disk space to run on WiredTiger databases. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Performance Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#performance-considerations" 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="performance-considerations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Compaction regularly checkpoints the database, which can lead to synchronization overhead. On high-traffic databases, this can potentially delay or prevent operational tasks such as taking backups. To avoid unexpected disruptions, disable compaction before taking a backup. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-compact-cmd-replica-sets"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Replica Sets <a class="headerlink leafygreen-ui-1kepx47" href="#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="replica-sets"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can use <code class="leafygreen-ui-1l06pbn"> compact </code> on collections and indexes that are stored in a replica set, however there are some important considerations: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The primary node does not replicate the <code class="leafygreen-ui-1l06pbn"> compact </code> command to the secondaries. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You should run <code class="leafygreen-ui-1l06pbn"> compact </code> on secondary nodes whenever possible. If you cannot run <code class="leafygreen-ui-1l06pbn"> compact </code> on secondaries, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-compact-force-option" target="_self"> <span> force </span> </a> option. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 6.1.0 (and 6.0.2 and 5.0.12): </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A secondary node can replicate while <code class="leafygreen-ui-1l06pbn"> compact </code> is running. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Reads are permitted. </p> </li> </ul> </li> </ul> <p class="leafygreen-ui-1kp3ins"> To run <code class="leafygreen-ui-1l06pbn"> compact </code> on a cluster </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Run compact on one of the secondary nodes. When compact\nfinishes, repeat the operation on each of the remaining\nsecondaries in turn.","name":"Compact the secondary nodes."},{"@type":"HowToStep","text":"To step down the current primary and trigger an election, use the\nrs.stepDown() method. To nominate a particular secondary\nnode, adjust the member priority.","name":"Reassign the primary node."},{"@type":"HowToStep","text":"After stepping down, the old primary node becomes a secondary\nnode. Run compact on the old primary node.","name":"Compact the old primary."}],"name":"Replica Sets","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-qum8nr eccljxs0"> <div class="css-vq8pj5 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-18jxsvu e1ckbxcu2"> 1 </div> </div> <div class="css-clrhqf"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Compact the secondary nodes. <a class="headerlink leafygreen-ui-1kepx47" href="#compact-the-secondary-nodes." 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="compact-the-secondary-nodes."> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Run <code class="leafygreen-ui-1l06pbn"> compact </code> on one of the secondary nodes. When <code class="leafygreen-ui-1l06pbn"> compact </code> finishes, repeat the operation on each of the remaining secondaries in turn. </p> </section> </div> </div> <div class="css-vq8pj5 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-18jxsvu e1ckbxcu2"> 2 </div> </div> <div class="css-clrhqf"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Reassign the primary node. <a class="headerlink leafygreen-ui-1kepx47" href="#reassign-the-primary-node." 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="reassign-the-primary-node."> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> To step down the current primary and trigger an election, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.stepDown/#mongodb-method-rs.stepDown"> <code class="leafygreen-ui-1l06pbn"> rs.stepDown() </code> </a> method. To nominate a particular secondary node, <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/adjust-replica-set-member-priority/#std-label-replica-set-adjust-priority"> adjust the member priority <!-- --> . </a> </p> </section> </div> </div> <div class="css-vq8pj5 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-18jxsvu e1ckbxcu2"> 3 </div> </div> <div class="css-clrhqf"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Compact the old primary. <a class="headerlink leafygreen-ui-1kepx47" href="#compact-the-old-primary." 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="compact-the-old-primary."> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> After stepping down, the old primary node becomes a secondary node. Run <code class="leafygreen-ui-1l06pbn"> compact </code> on the old primary node. </p> </section> </div> </div> </div> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Version Specific Considerations for Secondary Nodes <a class="headerlink leafygreen-ui-1kepx47" href="#version-specific-considerations-for-secondary-nodes" 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="version-specific-considerations-for-secondary-nodes"> </div> </a> </h4> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A secondary node can replicate while <code class="leafygreen-ui-1l06pbn"> compact </code> is running. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Reads are permitted. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> While the <code class="leafygreen-ui-1l06pbn"> compact </code> command is running, the replica set remains in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-states/#mongodb-replstate-replstate.SECONDARY"> <code class="leafygreen-ui-1l06pbn"> SECONDARY </code> </a> status. </p> <p class="leafygreen-ui-1kp3ins"> For more information about replica set member states, see See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-states/#std-label-replica-set-member-states"> Replica Set Member States <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> For replica set maintenance and availability, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/perform-maintence-on-replica-set-members/#std-label-perform-maint-on-replica-set"> Perform Maintenance on Self-Managed Replica Set Members <!-- --> . </a> </p> </section> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sharded Clusters <a class="headerlink leafygreen-ui-1kepx47" href="#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="sharded-clusters"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> compact </code> only applies to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances. In a sharded environment, run <code class="leafygreen-ui-1l06pbn"> compact </code> on each shard separately as a maintenance operation. </p> <p class="leafygreen-ui-1kp3ins"> You cannot issue <code class="leafygreen-ui-1l06pbn"> compact </code> against a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Index Building <a class="headerlink leafygreen-ui-1kepx47" href="#index-building" 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="index-building"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> rebuilds all indexes in parallel following the <code class="leafygreen-ui-1l06pbn"> compact </code> operation. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Concurrent Compact Commands Not Allowed <a class="headerlink leafygreen-ui-1kepx47" href="#concurrent-compact-commands-not-allowed" 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="concurrent-compact-commands-not-allowed"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you try to run multiple concurrent <code class="leafygreen-ui-1l06pbn"> compact </code> commands on the same collection, MongoDB returns an error. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Compact a Collection <a class="headerlink leafygreen-ui-1kepx47" href="#compact-a-collection" 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="compact-a-collection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following operation runs the <code class="leafygreen-ui-1l06pbn"> compact </code> command on the <code class="leafygreen-ui-1l06pbn"> movies </code> collection: </p> <div class="css-1f5771r"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand( { compact: \"movies\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>( <!-- -->{ <span class="lg-highlight-attr">compact</span>: <span class="lg-highlight-string">"movies"</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="css-9st569 efa38qy0" style="--border-color:#E8EDEB"> <button aria-disabled="false" class="lg-ui-button-0000 leafygreen-ui-hix6y6" data-lgid="lg-button" role="button" type="button"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg alt="" aria-hidden="true" class="leafygreen-ui-hjnzs9" fill="none" height="16" role="presentation" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M14.364 10.778a1 1 0 0 0 0-1.414l-4.95-4.95-.707-.707a1 1 0 0 0-1.414 0l-.707.707-4.95 4.95a1 1 0 0 0 0 1.414l.707.707a1 1 0 0 0 1.414 0L8 7.243l4.243 4.242a1 1 0 0 0 1.414 0l.707-.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> HIDE OUTPUT </div> </button> </div> <div class="leafygreen-ui-1oteowz"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ bytesFreed: 27859, ok: 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-1sax7hu e11q6jfk0" style="--code-container-border:initial;--code-pre-border:none"> <div class="leafygreen-ui-1fyvhqe"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1qhgg7e" tabindex="-1"><code class="lg-highlight-hljs-dark javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">bytesFreed</span>: <span class="lg-highlight-number">27859</span>, <span class="lg-highlight-attr">ok</span>: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Estimate Compaction <a class="headerlink leafygreen-ui-1kepx47" href="#estimate-compaction" 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="estimate-compaction"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following operation performs a dry run of the <code class="leafygreen-ui-1l06pbn"> compact </code> command on the <code class="leafygreen-ui-1l06pbn"> movies </code> collection: </p> <div class="css-1f5771r"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand( {\n compact: \"movies\",\n dryRun: true\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">compact</span>: <span class="lg-highlight-string">"movies"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dryRun</span>: <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="css-9st569 efa38qy0" style="--border-color:#E8EDEB"> <button aria-disabled="false" class="lg-ui-button-0000 leafygreen-ui-hix6y6" data-lgid="lg-button" role="button" type="button"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg alt="" aria-hidden="true" class="leafygreen-ui-hjnzs9" fill="none" height="16" role="presentation" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M14.364 10.778a1 1 0 0 0 0-1.414l-4.95-4.95-.707-.707a1 1 0 0 0-1.414 0l-.707.707-4.95 4.95a1 1 0 0 0 0 1.414l.707.707a1 1 0 0 0 1.414 0L8 7.243l4.243 4.242a1 1 0 0 0 1.414 0l.707-.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> HIDE OUTPUT </div> </button> </div> <div class="leafygreen-ui-1oteowz"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ estimatedBytesFreed: 27859, ok: 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-1sax7hu e11q6jfk0" style="--code-container-border:initial;--code-pre-border:none"> <div class="leafygreen-ui-1fyvhqe"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1qhgg7e" tabindex="-1"><code class="lg-highlight-hljs-dark javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">estimatedBytesFreed</span>: <span class="lg-highlight-number">27859</span>, <span class="lg-highlight-attr">ok</span>: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </section> </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> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/autoCompact/#mongodb-dbcommand-dbcmd.autoCompact"> <code class="leafygreen-ui-1l06pbn"> autoCompact </code> </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/applications/data-models-tree-structures/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Model Tree Structures <a class="headerlink leafygreen-ui-1kepx47" href="#model-tree-structures" 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="model-tree-structures"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> MongoDB allows various ways to use tree data structures to model large hierarchical or nested data relationships. </p> <div class="figure css-5vkxs0" style="width:760px"> <img alt="Tree data model for a sample hierarchy of categories." class="leafygreen-ui-1qnf57e" height="400" src="/docs/manual/images/data-model-tree.bakedsvg.svg" style="--border-color:#C1C7C6" width="540"/> </div> <dl> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/model-tree-structures-with-parent-references/"> Model Tree Structures with Parent References </a> </dt> <dd class="css-1ufxuu7"> Presents a data model that organizes documents in a tree-like structure by storing <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/concepts/embedding-vs-references/#std-label-data-modeling-referencing"> references </a> to "parent" nodes in "child" nodes. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/model-tree-structures-with-child-references/"> Model Tree Structures with Child References </a> </dt> <dd class="css-1ufxuu7"> Presents a data model that organizes documents in a tree-like structure by storing <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/concepts/embedding-vs-references/#std-label-data-modeling-referencing"> references </a> to "child" nodes in "parent" nodes. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/model-tree-structures-with-ancestors-array/"> Model Tree Structures with an Array of Ancestors </a> </dt> <dd class="css-1ufxuu7"> Presents a data model that organizes documents in a tree-like structure by storing <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/concepts/embedding-vs-references/#std-label-data-modeling-referencing"> references </a> to "parent" nodes and an array that stores all ancestors. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/model-tree-structures-with-materialized-paths/"> Model Tree Structures with Materialized Paths </a> </dt> <dd class="css-1ufxuu7"> Presents a data model that organizes documents in a tree-like structure by storing full relationship paths between documents. In addition to the tree node, each document stores the <code class="leafygreen-ui-1l06pbn"> _id </code> of the nodes ancestors or path as a string. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/model-tree-structures-with-nested-sets/"> Model Tree Structures with Nested Sets </a> </dt> <dd class="css-1ufxuu7"> Presents a data model that organizes documents in a tree-like structure using the <em> Nested Sets </em> pattern. This optimizes discovering subtrees at the expense of tree mutability. </dd> </dl> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/ne/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $ne (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-ne--aggregation-" 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="-ne--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $ne </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-ne" 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-expression-exp.-ne"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Compares two values and returns: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> true </code> when the values are not equivalent. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> false </code> when the values are equivalent. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-ne" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $ne </code> </span> </a> compares both value and type, using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-type-comparison-order/#std-label-bson-types-comparison-order"> specified BSON comparison order </a> for values of different types. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-ne" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $ne </code> </span> </a> has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $ne: [ &lt;expression1&gt;, &lt;expression2&gt; ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$ne</span>: <!-- -->[ &lt;<!-- -->expression1<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->expression2<!-- -->&gt; <!-- -->] }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on expressions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> Expression Operators <!-- --> . </a> </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Consider an <code class="leafygreen-ui-1l06pbn"> inventory </code> collection with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"item\" : \"abc1\", description: \"product 1\", qty: 300 }\n{ \"_id\" : 2, \"item\" : \"abc2\", description: \"product 2\", qty: 200 }\n{ \"_id\" : 3, \"item\" : \"xyz1\", description: \"product 3\", qty: 250 }\n{ \"_id\" : 4, \"item\" : \"VWZ1\", description: \"product 4\", qty: 300 }\n{ \"_id\" : 5, \"item\" : \"VWZ2\", description: \"product 5\", qty: 180 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc1"</span>, <span class="lg-highlight-attr">description</span>: <span class="lg-highlight-string">"product 1"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">300</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc2"</span>, <span class="lg-highlight-attr">description</span>: <span class="lg-highlight-string">"product 2"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">200</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz1"</span>, <span class="lg-highlight-attr">description</span>: <span class="lg-highlight-string">"product 3"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">250</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"VWZ1"</span>, <span class="lg-highlight-attr">description</span>: <span class="lg-highlight-string">"product 4"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">300</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"VWZ2"</span>, <span class="lg-highlight-attr">description</span>: <span class="lg-highlight-string">"product 5"</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">180</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-ne" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $ne </code> </span> </a> operator to determine if <code class="leafygreen-ui-1l06pbn"> qty </code> does not equal <code class="leafygreen-ui-1l06pbn"> 250 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.aggregate(\n [\n {\n $project:\n {\n item: 1,\n qty: 1,\n qtyNe250: { $ne: [ \"$qty\", 250 ] },\n _id: 0\n }\n }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">qtyNe250</span>: <!-- -->{ <span class="lg-highlight-attr">$ne</span>: <!-- -->[ <span class="lg-highlight-string">"$qty"</span>, <span class="lg-highlight-number">250</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"item\" : \"abc1\", \"qty\" : 300, \"qtyNe250\" : true }\n{ \"item\" : \"abc2\", \"qty\" : 200, \"qtyNe250\" : true }\n{ \"item\" : \"xyz1\", \"qty\" : 250, \"qtyNe250\" : false }\n{ \"item\" : \"VWZ1\", \"qty\" : 300, \"qtyNe250\" : true }\n{ \"item\" : \"VWZ2\", \"qty\" : 180, \"qtyNe250\" : true }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc1"</span>, <span class="lg-highlight-string">"qty"</span> <!-- -->: <span class="lg-highlight-number">300</span>, <span class="lg-highlight-string">"qtyNe250"</span> <!-- -->: <span class="lg-highlight-literal">true</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc2"</span>, <span class="lg-highlight-string">"qty"</span> <!-- -->: <span class="lg-highlight-number">200</span>, <span class="lg-highlight-string">"qtyNe250"</span> <!-- -->: <span class="lg-highlight-literal">true</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz1"</span>, <span class="lg-highlight-string">"qty"</span> <!-- -->: <span class="lg-highlight-number">250</span>, <span class="lg-highlight-string">"qtyNe250"</span> <!-- -->: <span class="lg-highlight-literal">false</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"VWZ1"</span>, <span class="lg-highlight-string">"qty"</span> <!-- -->: <span class="lg-highlight-number">300</span>, <span class="lg-highlight-string">"qtyNe250"</span> <!-- -->: <span class="lg-highlight-literal">true</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"VWZ2"</span>, <span class="lg-highlight-string">"qty"</span> <!-- -->: <span class="lg-highlight-number">180</span>, <span class="lg-highlight-string">"qtyNe250"</span> <!-- -->: <span class="lg-highlight-literal">true</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> </section> </section>
https://www.mongodb.com/docs/manual/reference/supported-shard-direct-commands/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Shard Direct Commands <a class="headerlink leafygreen-ui-1kepx47" href="#shard-direct-commands" 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="shard-direct-commands"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, these are the <em> only </em> commands you may run directly on a shard. You may also run a shell helper directly on a shard if it calls one of the following commands: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/abortTransaction/#mongodb-dbcommand-dbcmd.abortTransaction"> <code class="leafygreen-ui-1l06pbn"> abortTransaction </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/appendOplogNote/#mongodb-dbcommand-dbcmd.appendOplogNote"> <code class="leafygreen-ui-1l06pbn"> appendOplogNote </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/authenticate/#mongodb-dbcommand-dbcmd.authenticate"> <code class="leafygreen-ui-1l06pbn"> authenticate </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/autoCompact/#mongodb-dbcommand-dbcmd.autoCompact"> <code class="leafygreen-ui-1l06pbn"> autoCompact </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/buildInfo/#mongodb-dbcommand-dbcmd.buildInfo"> <code class="leafygreen-ui-1l06pbn"> buildInfo </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/commitTransaction/#mongodb-dbcommand-dbcmd.commitTransaction"> <code class="leafygreen-ui-1l06pbn"> commitTransaction </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/compact/#mongodb-dbcommand-dbcmd.compact"> <code class="leafygreen-ui-1l06pbn"> compact </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/connectionStatus/#mongodb-dbcommand-dbcmd.connectionStatus"> <code class="leafygreen-ui-1l06pbn"> connectionStatus </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/connPoolStats/#mongodb-dbcommand-dbcmd.connPoolStats"> <code class="leafygreen-ui-1l06pbn"> connPoolStats </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createRole/#mongodb-dbcommand-dbcmd.createRole"> <code class="leafygreen-ui-1l06pbn"> createRole </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createUser/#mongodb-dbcommand-dbcmd.createUser"> <code class="leafygreen-ui-1l06pbn"> createUser </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-dbcommand-dbcmd.currentOp"> <code class="leafygreen-ui-1l06pbn"> currentOp </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dropAllRolesFromDatabase/#mongodb-dbcommand-dbcmd.dropAllRolesFromDatabase"> <code class="leafygreen-ui-1l06pbn"> dropAllRolesFromDatabase </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dropAllUsersFromDatabase/#mongodb-dbcommand-dbcmd.dropAllUsersFromDatabase"> <code class="leafygreen-ui-1l06pbn"> dropAllUsersFromDatabase </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dropRole/#mongodb-dbcommand-dbcmd.dropRole"> <code class="leafygreen-ui-1l06pbn"> dropRole </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dropUser/#mongodb-dbcommand-dbcmd.dropUser"> <code class="leafygreen-ui-1l06pbn"> dropUser </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/endSessions/#mongodb-dbcommand-dbcmd.endSessions"> <code class="leafygreen-ui-1l06pbn"> endSessions </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/flushRouterConfig/#mongodb-dbcommand-dbcmd.flushRouterConfig"> <code class="leafygreen-ui-1l06pbn"> flushRouterConfig </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/fsync/#mongodb-dbcommand-dbcmd.fsync"> <code class="leafygreen-ui-1l06pbn"> fsync </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/fsyncUnlock/#mongodb-dbcommand-dbcmd.fsyncUnlock"> <code class="leafygreen-ui-1l06pbn"> fsyncUnlock </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getAuditConfig/#mongodb-dbcommand-dbcmd.getAuditConfig"> <code class="leafygreen-ui-1l06pbn"> getAuditConfig </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getClusterParameter/#mongodb-dbcommand-dbcmd.getClusterParameter"> <code class="leafygreen-ui-1l06pbn"> getClusterParameter </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getCmdLineOpts/#mongodb-dbcommand-dbcmd.getCmdLineOpts"> <code class="leafygreen-ui-1l06pbn"> getCmdLineOpts </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getLog/#mongodb-dbcommand-dbcmd.getLog"> <code class="leafygreen-ui-1l06pbn"> getLog </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getParameter/#mongodb-dbcommand-dbcmd.getParameter"> <code class="leafygreen-ui-1l06pbn"> getParameter </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getShardMap/#mongodb-dbcommand-dbcmd.getShardMap"> <code class="leafygreen-ui-1l06pbn"> getShardMap </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/grantPrivilegesToRole/#mongodb-dbcommand-dbcmd.grantPrivilegesToRole"> <code class="leafygreen-ui-1l06pbn"> grantPrivilegesToRole </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/grantRolesToRole/#mongodb-dbcommand-dbcmd.grantRolesToRole"> <code class="leafygreen-ui-1l06pbn"> grantRolesToRole </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/grantRolesToUser/#mongodb-dbcommand-dbcmd.grantRolesToUser"> <code class="leafygreen-ui-1l06pbn"> grantRolesToUser </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hello/#mongodb-dbcommand-dbcmd.hello"> <code class="leafygreen-ui-1l06pbn"> hello </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hostInfo/#mongodb-dbcommand-dbcmd.hostInfo"> <code class="leafygreen-ui-1l06pbn"> hostInfo </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/invalidateUserCache/#mongodb-dbcommand-dbcmd.invalidateUserCache"> <code class="leafygreen-ui-1l06pbn"> invalidateUserCache </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/killAllSessions/#mongodb-dbcommand-dbcmd.killAllSessions"> <code class="leafygreen-ui-1l06pbn"> killAllSessions </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/killAllSessionsByPattern/#mongodb-dbcommand-dbcmd.killAllSessionsByPattern"> <code class="leafygreen-ui-1l06pbn"> killAllSessionsByPattern </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/killCursors/#mongodb-dbcommand-dbcmd.killCursors"> <code class="leafygreen-ui-1l06pbn"> killCursors </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/killOp/#mongodb-dbcommand-dbcmd.killOp"> <code class="leafygreen-ui-1l06pbn"> killOp </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/killSessions/#mongodb-dbcommand-dbcmd.killSessions"> <code class="leafygreen-ui-1l06pbn"> killSessions </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/listCommands/#mongodb-dbcommand-dbcmd.listCommands"> <code class="leafygreen-ui-1l06pbn"> listCommands </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/lockInfo/#mongodb-dbcommand-dbcmd.lockInfo"> <code class="leafygreen-ui-1l06pbn"> lockInfo </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/logApplicationMessage/#mongodb-dbcommand-dbcmd.logApplicationMessage"> <code class="leafygreen-ui-1l06pbn"> logApplicationMessage </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/logout/#mongodb-dbcommand-dbcmd.logout"> <code class="leafygreen-ui-1l06pbn"> logout </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/logRotate/#mongodb-dbcommand-dbcmd.logRotate"> <code class="leafygreen-ui-1l06pbn"> logRotate </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/ping/#mongodb-dbcommand-dbcmd.ping"> <code class="leafygreen-ui-1l06pbn"> ping </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/profile/#mongodb-dbcommand-dbcmd.profile"> <code class="leafygreen-ui-1l06pbn"> profile </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetAbortPrimaryCatchUp/#mongodb-dbcommand-dbcmd.replSetAbortPrimaryCatchUp"> <code class="leafygreen-ui-1l06pbn"> replSetAbortPrimaryCatchUp </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetFreeze/#mongodb-dbcommand-dbcmd.replSetFreeze"> <code class="leafygreen-ui-1l06pbn"> replSetFreeze </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetGetConfig/#mongodb-dbcommand-dbcmd.replSetGetConfig"> <code class="leafygreen-ui-1l06pbn"> replSetGetConfig </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetGetStatus/#mongodb-dbcommand-dbcmd.replSetGetStatus"> <code class="leafygreen-ui-1l06pbn"> replSetGetStatus </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetMaintenance/#mongodb-dbcommand-dbcmd.replSetMaintenance"> <code class="leafygreen-ui-1l06pbn"> replSetMaintenance </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetReconfig/#mongodb-dbcommand-dbcmd.replSetReconfig"> <code class="leafygreen-ui-1l06pbn"> replSetReconfig </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetResizeOplog/#mongodb-dbcommand-dbcmd.replSetResizeOplog"> <code class="leafygreen-ui-1l06pbn"> replSetResizeOplog </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetStepDown/#mongodb-dbcommand-dbcmd.replSetStepDown"> <code class="leafygreen-ui-1l06pbn"> replSetStepDown </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetSyncFrom/#mongodb-dbcommand-dbcmd.replSetSyncFrom"> <code class="leafygreen-ui-1l06pbn"> replSetSyncFrom </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/revokePrivilegesFromRole/#mongodb-dbcommand-dbcmd.revokePrivilegesFromRole"> <code class="leafygreen-ui-1l06pbn"> revokePrivilegesFromRole </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/revokeRolesFromRole/#mongodb-dbcommand-dbcmd.revokeRolesFromRole"> <code class="leafygreen-ui-1l06pbn"> revokeRolesFromRole </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/revokeRolesFromUser/#mongodb-dbcommand-dbcmd.revokeRolesFromUser"> <code class="leafygreen-ui-1l06pbn"> revokeRolesFromUser </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/rolesInfo/#mongodb-dbcommand-dbcmd.rolesInfo"> <code class="leafygreen-ui-1l06pbn"> rolesInfo </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/rotateCertificates/#mongodb-dbcommand-dbcmd.rotateCertificates"> <code class="leafygreen-ui-1l06pbn"> rotateCertificates </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-dbcommand-dbcmd.serverStatus"> <code class="leafygreen-ui-1l06pbn"> serverStatus </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setParameter/#mongodb-dbcommand-dbcmd.setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/shardingState/#mongodb-dbcommand-dbcmd.shardingState"> <code class="leafygreen-ui-1l06pbn"> shardingState </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/startSession/#mongodb-dbcommand-dbcmd.startSession"> <code class="leafygreen-ui-1l06pbn"> startSession </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/top/#mongodb-dbcommand-dbcmd.top"> <code class="leafygreen-ui-1l06pbn"> top </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/updateRole/#mongodb-dbcommand-dbcmd.updateRole"> <code class="leafygreen-ui-1l06pbn"> updateRole </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/updateUser/#mongodb-dbcommand-dbcmd.updateUser"> <code class="leafygreen-ui-1l06pbn"> updateUser </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/usersInfo/#mongodb-dbcommand-dbcmd.usersInfo"> <code class="leafygreen-ui-1l06pbn"> usersInfo </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/whatsmyuri/#mongodb-dbcommand-dbcmd.whatsmyuri"> <code class="leafygreen-ui-1l06pbn"> whatsmyuri </code> </a> </p> </li> </ul> </section>
https://www.mongodb.com/docs/manual/reference/method/db.collection.dropIndex/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.collection.dropIndex() <a class="headerlink leafygreen-ui-1kepx47" href="#db.collection.dropindex--" 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.collection.dropindex--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <div class="leafygreen-ui-147elvs"> <p class="leafygreen-ui-1ronz74"> MongoDB with drivers </p> <div class="leafygreen-ui-18k5rfm"> <p class="leafygreen-ui-1kp3ins"> This page documents 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> method. To see the equivalent method in a MongoDB driver, see the corresponding page for your programming language: </p> </div> <div class="leafygreen-ui-zgrwqu notranslate"> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/drivers/csharp/upcoming/fundamentals/indexes/#drop-a-search-index" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_1351_59964)"> <g clip-path="url(#clip1_1351_59964)"> <path d="M25.7709 9.2495C25.7709 8.79827 25.678 8.39408 25.4827 8.04627C25.2874 7.70785 25.0084 7.42586 24.627 7.20025C21.465 5.35781 18.2937 3.51538 15.1317 1.67295C14.2761 1.17474 13.4484 1.19354 12.6021 1.70115C11.3466 2.45316 5.04112 6.10042 3.15321 7.20025C2.3813 7.65142 2 8.34705 2 9.24005C2 12.9531 2 16.6568 2 20.3698C2 20.8117 2.093 21.2064 2.279 21.5449C2.4743 21.8927 2.7626 22.1841 3.15321 22.4191C5.03182 23.5189 11.3373 27.1662 12.6021 27.9182C13.4484 28.4258 14.2761 28.4446 15.1317 27.9463C18.2937 26.1039 21.465 24.2615 24.627 22.4191C25.0177 22.1935 25.306 21.9021 25.5012 21.5449C25.6873 21.2064 25.7803 20.8117 25.7803 20.3698C25.7709 20.3698 25.7709 12.9531 25.7709 9.2495Z" fill="#A179DC"> </path> <path d="M13.9227 14.7673L2.27905 21.5449C2.47435 21.8927 2.76265 22.1841 3.15326 22.4191C5.03187 23.5189 11.3373 27.1662 12.6021 27.9182C13.4484 28.4258 14.2762 28.4445 15.1317 27.9463C18.2938 26.1039 21.4651 24.2615 24.6271 22.4191C25.0177 22.1935 25.306 21.9021 25.5013 21.5449L13.9227 14.7673Z" fill="#280068"> </path> <path d="M25.7711 9.24949C25.7711 8.79827 25.6781 8.39408 25.4828 8.04626L13.9229 14.7768L25.4921 21.5543C25.6781 21.2159 25.7711 20.8211 25.7711 20.3793C25.7711 20.3699 25.7711 12.9531 25.7711 9.24949Z" fill="#390091"> </path> <path d="M20.7771 12.2387V13.5078H22.0325V12.2387H22.6557V13.5078H23.9111V14.1376H22.6557V15.4066H23.9111V16.0364H22.6557V17.3054H22.0325V16.0364H20.7771V17.3054H20.1539V16.0364H18.8984V15.4066H20.1539V14.1376H18.8984V13.5078H20.1539V12.2387H20.7771ZM22.0325 14.1376H20.7771V15.4066H22.0325V14.1376Z" fill="white"> </path> <path d="M13.9508 5.87482C17.2151 5.87482 20.0702 7.67022 21.6047 10.3399L21.5861 10.3117L17.7452 12.5489C16.9919 11.2517 15.5969 10.3775 14.0066 10.3587H13.9601C11.5328 10.3587 9.56116 12.3515 9.56116 14.805C9.56116 15.604 9.77503 16.3654 10.1377 17.014C10.9004 18.3488 12.3232 19.2512 13.9601 19.2512C15.6062 19.2512 17.0384 18.3394 17.7917 16.9858L17.7731 17.014L21.614 19.2606C20.0981 21.9021 17.2895 23.6975 14.0531 23.7257H13.9508C10.6679 23.7257 7.81274 21.9209 6.28753 19.2418C5.54353 17.9352 5.11572 16.4124 5.11572 14.7956C5.11572 9.87931 9.06825 5.87482 13.9508 5.87482Z" fill="white"> </path> </g> </g> <defs> <clippath id="clip0_1351_59964"> <rect fill="white" height="28" transform="translate(0 0.809265)" width="28"> </rect> </clippath> <clippath id="clip1_1351_59964"> <rect fill="white" height="27" transform="translate(2 1.30966)" width="24"> </rect> </clippath> </defs> </svg> <span> C# </span> </a> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/indexes/#remove-an-index-using-an-index-specification-document" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 30 41" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M10.0921 30.7949C10.0921 30.7949 8.57608 31.6793 11.166 31.9636C14.2929 32.311 15.9037 32.2794 19.3464 31.6161C19.3464 31.6161 20.2623 32.1846 21.5257 32.6901C13.7876 35.9748 4.02791 32.5005 10.0921 30.7949Z" fill="#0074BD"> </path> <path d="M9.14539 26.4678C9.14539 26.4678 7.43985 27.7312 10.0298 27.9838C13.3778 28.3312 15.9992 28.3628 20.579 27.4785C20.579 27.4785 21.2107 28.1101 22.1898 28.4576C12.8724 31.2054 2.44949 28.6787 9.14539 26.4678Z" fill="#0074BD"> </path> <path d="M17.1039 19.1398C18.9989 21.3191 16.5985 23.3089 16.5985 23.3089C16.5985 23.3089 21.431 20.8138 19.2201 17.6869C17.1355 14.7811 15.5563 13.3282 24.1788 8.33789C24.1473 8.33789 10.6607 11.6858 17.1039 19.1398Z" fill="#EA2D2E"> </path> <path d="M27.3377 33.9845C27.3377 33.9845 28.4431 34.9004 26.1059 35.6269C21.6525 36.985 7.53417 37.3957 3.61769 35.6901C2.19639 35.0899 4.84949 34.2372 5.67069 34.0477C6.52347 33.8582 7.02884 33.8898 7.02884 33.8898C5.44961 32.7843 -3.10981 36.0691 2.67016 36.9851C18.4308 39.5433 31.4121 35.8164 27.3377 33.9845Z" fill="#0074BD"> </path> <path d="M10.8194 21.983C10.8194 21.983 3.6497 23.6885 8.2926 24.3203C10.2509 24.5729 14.1357 24.5097 17.7995 24.2255C20.7685 23.9728 23.7375 23.4359 23.7375 23.4359C23.7375 23.4359 22.6951 23.8781 21.9372 24.415C14.6411 26.3416 0.585992 25.4257 4.62881 23.4675C8.00839 21.7935 10.8194 21.983 10.8194 21.983Z" fill="#0074BD"> </path> <path d="M23.6745 29.1846C31.0969 25.3313 27.6542 21.6359 25.2538 22.1413C24.6537 22.2676 24.401 22.3623 24.401 22.3623C24.401 22.3623 24.6221 22.0149 25.0327 21.8886C29.7703 20.2146 33.4025 26.7842 23.5166 29.4057C23.5482 29.3741 23.6429 29.2794 23.6745 29.1846Z" fill="#0074BD"> </path> <path d="M19.2206 0.25293C19.2206 0.25293 23.3266 4.35891 15.3357 10.6758C8.92404 15.7293 13.8828 18.6351 15.3357 21.9199C11.6087 18.5403 8.86088 15.5714 10.6928 12.792C13.3775 8.74919 20.863 6.79093 19.2206 0.25293Z" fill="#EA2D2E"> </path> <path d="M11.5455 39.6068C18.6521 40.049 29.5803 39.3541 29.833 35.9746C29.833 35.9746 29.3276 37.238 23.9583 38.2487C17.894 39.3858 10.4085 39.2594 5.95508 38.533C5.95508 38.5646 6.87103 39.3225 11.5455 39.6068Z" fill="#0074BD"> </path> </svg> <span> Java Sync </span> </a> <a class="leafygreen-ui-v22cck" href="https://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#dropIndex" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 30 30" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:R2du9qcmqn9:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":R2du9qcmqn9:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":R2du9qcmqn9:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":R2du9qcmqn9:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <span> Node.js </span> </a> <a class="leafygreen-ui-v22cck" href="https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.collection.Collection.drop_index" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 111.6 147" width="24" xmlns="http://www.w3.org/2000/svg"> <lineargradient gradienttransform="matrix(.5625 0 0 -.568 -160.323 -146.09)" gradientunits="userSpaceOnUse" id=":R2hu9qcmqn9:aa" x1="280.848" x2="389.865" y1="-268.463" y2="-362.257"> <stop offset="0" stop-color="#5a9fd4"> </stop> <stop offset="1" stop-color="#306998"> </stop> </lineargradient> <path d="M55.3 3.2c-4.6 0-9 .4-12.8 1.1-11.3 2-13.4 6.2-13.4 13.9v10.2h26.8v3.4H19c-7.8 0-14.6 4.7-16.8 13.6C-.3 55.6-.4 62 2.2 72.7c1.9 7.9 6.5 13.6 14.2 13.6h9.2V74c0-8.8 7.7-16.7 16.7-16.7h26.8c7.5 0 13.4-6.1 13.4-13.6V18.2c0-7.3-6.1-12.7-13.4-13.9-4.4-.8-9.2-1.1-13.8-1.1zm-14.5 8.2c2.8 0 5 2.3 5 5.1s-2.3 5.1-5 5.1c-2.8 0-5-2.3-5-5.1s2.2-5.1 5-5.1z" fill="url(#:R2hu9qcmqn9:aa)"> </path> <lineargradient gradienttransform="matrix(.5625 0 0 -.568 -160.323 -146.09)" gradientunits="userSpaceOnUse" id=":R2hu9qcmqn9:bb" x1="432.011" x2="393.081" y1="-419.025" y2="-363.946"> <stop offset="0" stop-color="#ffd43b"> </stop> <stop offset="1" stop-color="#ffe873"> </stop> </lineargradient> <path d="M86 31.8v11.9c0 9.2-7.8 17-16.8 17H42.5c-7.3 0-13.4 6.3-13.4 13.6v25.5c0 7.3 6.3 11.5 13.4 13.6 8.5 2.5 16.6 2.9 26.8 0 6.8-2 13.4-5.9 13.4-13.6V89.7H55.9v-3.4h40.2c7.8 0 10.7-5.4 13.4-13.6 2.8-8.4 2.7-16.5 0-27.3-1.9-7.8-5.6-13.6-13.4-13.6H86zM71 96.5c2.8 0 5 2.3 5 5.1s-2.3 5.1-5 5.1c-2.8 0-5-2.3-5-5.1-.1-2.8 2.2-5.1 5-5.1z" fill="url(#:R2hu9qcmqn9:bb)"> </path> <radialgradient cx="-2274.721" cy="144.526" gradienttransform="matrix(0 -.2399 -1.0547 0 208.637 -414.922)" gradientunits="userSpaceOnUse" id=":R2hu9qcmqn9:cc" r="29.037"> <stop offset="0" stop-color="#b8b8b8" stop-opacity=".498"> </stop> <stop offset="1" stop-color="#7f7f7f" stop-opacity="0"> </stop> </radialgradient> <path d="M92.1 130.9c0 3.8-16.1 7-35.9 7s-35.9-3.1-35.9-7c0-3.8 16.1-7 35.9-7s35.9 3.1 35.9 7z" fill="url(#:R2hu9qcmqn9:cc)" opacity=".444"> </path> </svg> <span> PyMongo </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://mongoc.org/libmongoc/current/mongoc_collection_drop_index.html" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_1351_59955)"> <g clip-path="url(#clip1_1351_59955)"> <path clip-rule="evenodd" d="M13.118 1.49532C13.5403 1.25103 14.0559 1.25103 14.4783 1.49532C16.5652 2.70389 22.8385 6.34889 24.9193 7.55748C25.3416 7.80172 25.6025 8.25176 25.6025 8.74672C25.6025 11.1703 25.6025 18.4539 25.6025 20.8774C25.6025 21.366 25.3416 21.8224 24.9193 22.0667C22.8385 23.2753 16.5652 26.9203 14.4783 28.1289C14.0559 28.3732 13.5403 28.3732 13.118 28.1289C11.0373 26.9139 4.76398 23.2689 2.68323 22.0603C2.26087 21.816 2 21.366 2 20.871C2 18.4474 2 11.1639 2 8.7403C2 8.25176 2.26087 7.7953 2.68323 7.55106C4.76398 6.34889 11.0373 2.70389 13.118 1.49532Z" fill="#004482" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M2.18634 21.4946C2.01863 21.2632 2 21.051 2 20.7553C2 18.351 2 11.1061 2 8.70176C2 8.21317 2.26087 7.76319 2.67702 7.51889C4.75776 6.31675 11.0062 2.69104 13.0807 1.4889C13.5031 1.24461 14.0683 1.25104 14.4907 1.49533C16.5652 2.69747 22.795 6.29104 24.8696 7.49319C25.0373 7.58963 25.1677 7.70535 25.2795 7.86606L2.18634 21.4946Z" fill="#659AD2" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M13.8011 5.8089C18.6024 5.8089 22.4968 9.83964 22.4968 14.8089C22.4968 19.7782 18.6024 23.8089 13.8011 23.8089C8.99986 23.8089 5.10547 19.7782 5.10547 14.8089C5.10547 9.83964 8.99986 5.8089 13.8011 5.8089ZM13.8011 10.3089C16.1987 10.3089 18.1489 12.3275 18.1489 14.8089C18.1489 17.2903 16.1987 19.3089 13.8011 19.3089C11.4036 19.3089 9.4533 17.2903 9.4533 14.8089C9.4533 12.3275 11.4036 10.3089 13.8011 10.3089Z" fill="white" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M25.2857 7.87247C25.6087 8.18102 25.6025 8.65034 25.6025 9.01673C25.6025 11.4596 25.5839 18.396 25.6087 20.8325C25.6087 21.0896 25.528 21.3532 25.4099 21.5589L13.5466 14.8089L25.2857 7.87247Z" fill="#00599C" fill-rule="evenodd"> </path> </g> </g> <defs> <clippath id="clip0_1351_59955"> <rect fill="white" height="28" transform="translate(0 0.809265)" width="28"> </rect> </clippath> <clippath id="clip1_1351_59955"> <rect fill="white" height="27" transform="translate(2 1.30887)" width="24"> </rect> </clippath> </defs> </svg> <span> C </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/languages/cpp/cpp-driver/upcoming/work-with-indexes/#remove-an-index" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_1351_59959)"> <g clip-path="url(#clip1_1351_59959)"> <path d="M25.4013 21.5646C25.5872 21.2353 25.7034 20.8745 25.7034 20.5373V9.08012C25.7034 8.75078 25.5872 8.38217 25.4013 8.05283L13.8516 14.8127L25.4013 21.5646Z" fill="#00599C"> </path> <path d="M14.8738 28.0657L24.6729 22.3411C24.9517 22.1764 25.2151 21.8941 25.401 21.5647L13.8513 14.8127L2.30151 21.5647C2.48743 21.8941 2.74305 22.1764 3.02967 22.3411L12.8288 28.0657C13.3865 28.3951 14.316 28.3951 14.8738 28.0657Z" fill="#004482"> </path> <path d="M25.4011 8.06086C25.2152 7.73146 24.9596 7.44915 24.673 7.2845L14.8739 1.55983C14.3084 1.23046 13.3866 1.23046 12.8211 1.55983L3.02202 7.2845C2.46429 7.61385 1.99951 8.42158 1.99951 9.08033V20.5375C1.99951 20.8669 2.11571 21.2354 2.30162 21.5647L13.8514 14.8128L25.4011 8.06086Z" fill="#659AD2"> </path> <path d="M13.8512 22.8115C9.49778 22.8115 5.94995 19.2199 5.94995 14.8127C5.94995 10.4055 9.49778 6.81387 13.8512 6.81387C16.6631 6.81387 19.2813 8.34305 20.6912 10.8133L17.2751 12.813C16.5701 11.5818 15.261 10.8133 13.8512 10.8133C11.6745 10.8133 9.90055 12.6091 9.90055 14.8127C9.90055 17.0163 11.6745 18.8121 13.8512 18.8121C15.261 18.8121 16.5701 18.0436 17.2751 16.8124L20.6912 18.8121C19.2813 21.2745 16.6631 22.8115 13.8512 22.8115Z" fill="white"> </path> <path d="M21.7524 14.3657H20.8771V13.4796H19.994V14.3657H19.1187V15.2518H19.994V16.1458H20.8771V15.2518H21.7524V14.3657Z" fill="white"> </path> <path d="M25.0446 14.3657H24.1693V13.4796H23.2862V14.3657H22.4109V15.2518H23.2862V16.1458H24.1693V15.2518H25.0446V14.3657Z" fill="white"> </path> </g> </g> <defs> <clippath id="clip0_1351_59959"> <rect fill="white" height="28" transform="translate(0 0.809265)" width="28"> </rect> </clippath> <clippath id="clip1_1351_59959"> <rect fill="white" height="27" transform="translate(1.99951 1.30878)" width="24"> </rect> </clippath> </defs> </svg> <span> C++ </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://pkg.go.dev/github.com/GabrielHCataldo/go-mongo-template/mongo/option#DropIndex" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" id="Layer_1" style="fill:#00ACD7" version="1.1" viewbox="0 0 205.4 76.7" width="24" x="0" xmlns="http://www.w3.org/2000/svg" y="0"> <path class="st00" d="M15.5 23.2c-.4 0-.5-.2-.3-.5l2.1-2.7c.2-.3.7-.5 1.1-.5h35.7c.4 0 .5.3.3.6l-1.7 2.6c-.2.3-.7.6-1 .6l-36.2-.1zM.4 32.4c-.4 0-.5-.2-.3-.5l2.1-2.7c.2-.3.7-.5 1.1-.5h45.6c.4 0 .6.3.5.6l-.8 2.4c-.1.4-.5.6-.9.6l-47.3.1zM24.6 41.6c-.4 0-.5-.3-.3-.6l1.4-2.5c.2-.3.6-.6 1-.6h20c.4 0 .6.3.6.7l-.2 2.4c0 .4-.4.7-.7.7l-21.8-.1z"> </path> <g id="CXHf1q_3_"> <path class="st00" d="M128.4 21.4c-6.3 1.6-10.6 2.8-16.8 4.4-1.5.4-1.6.5-2.9-1-1.5-1.7-2.6-2.8-4.7-3.8-6.3-3.1-12.4-2.2-18.1 1.5-6.8 4.4-10.3 10.9-10.2 19 .1 8 5.6 14.6 13.5 15.7 6.8.9 12.5-1.5 17-6.6.9-1.1 1.7-2.3 2.7-3.7H89.6c-2.1 0-2.6-1.3-1.9-3 1.3-3.1 3.7-8.3 5.1-10.9.3-.6 1-1.6 2.5-1.6h36.4c-.2 2.7-.2 5.4-.6 8.1-1.1 7.2-3.8 13.8-8.2 19.6-7.2 9.5-16.6 15.4-28.5 17-9.8 1.3-18.9-.6-26.9-6.6-7.4-5.6-11.6-13-12.7-22.2-1.3-10.9 1.9-20.7 8.5-29.3C70.4 8.7 79.8 2.8 91.3.7c9.4-1.7 18.4-.6 26.5 4.9 5.3 3.5 9.1 8.3 11.6 14.1.6.9.2 1.4-1 1.7z"> </path> <path class="st00" d="M161.5 76.7c-9.1-.2-17.4-2.8-24.4-8.8-5.9-5.1-9.6-11.6-10.8-19.3-1.8-11.3 1.3-21.3 8.1-30.2 7.3-9.6 16.1-14.6 28-16.7 10.2-1.8 19.8-.8 28.5 5.1 7.9 5.4 12.8 12.7 14.1 22.3 1.7 13.5-2.2 24.5-11.5 33.9-6.6 6.7-14.7 10.9-24 12.8-2.7.5-5.4.6-8 .9zm23.8-40.4c-.1-1.3-.1-2.3-.3-3.3-1.8-9.9-10.9-15.5-20.4-13.3-9.3 2.1-15.3 8-17.5 17.4-1.8 7.8 2 15.7 9.2 18.9 5.5 2.4 11 2.1 16.3-.6 7.9-4.1 12.2-10.5 12.7-19.1z"> </path> </g> </svg> <span> Go </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoCollection.html#dropIndex(org.bson.conversions.Bson)" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 30 41" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M10.0921 30.7949C10.0921 30.7949 8.57608 31.6793 11.166 31.9636C14.2929 32.311 15.9037 32.2794 19.3464 31.6161C19.3464 31.6161 20.2623 32.1846 21.5257 32.6901C13.7876 35.9748 4.02791 32.5005 10.0921 30.7949Z" fill="#0074BD"> </path> <path d="M9.14539 26.4678C9.14539 26.4678 7.43985 27.7312 10.0298 27.9838C13.3778 28.3312 15.9992 28.3628 20.579 27.4785C20.579 27.4785 21.2107 28.1101 22.1898 28.4576C12.8724 31.2054 2.44949 28.6787 9.14539 26.4678Z" fill="#0074BD"> </path> <path d="M17.1039 19.1398C18.9989 21.3191 16.5985 23.3089 16.5985 23.3089C16.5985 23.3089 21.431 20.8138 19.2201 17.6869C17.1355 14.7811 15.5563 13.3282 24.1788 8.33789C24.1473 8.33789 10.6607 11.6858 17.1039 19.1398Z" fill="#EA2D2E"> </path> <path d="M27.3377 33.9845C27.3377 33.9845 28.4431 34.9004 26.1059 35.6269C21.6525 36.985 7.53417 37.3957 3.61769 35.6901C2.19639 35.0899 4.84949 34.2372 5.67069 34.0477C6.52347 33.8582 7.02884 33.8898 7.02884 33.8898C5.44961 32.7843 -3.10981 36.0691 2.67016 36.9851C18.4308 39.5433 31.4121 35.8164 27.3377 33.9845Z" fill="#0074BD"> </path> <path d="M10.8194 21.983C10.8194 21.983 3.6497 23.6885 8.2926 24.3203C10.2509 24.5729 14.1357 24.5097 17.7995 24.2255C20.7685 23.9728 23.7375 23.4359 23.7375 23.4359C23.7375 23.4359 22.6951 23.8781 21.9372 24.415C14.6411 26.3416 0.585992 25.4257 4.62881 23.4675C8.00839 21.7935 10.8194 21.983 10.8194 21.983Z" fill="#0074BD"> </path> <path d="M23.6745 29.1846C31.0969 25.3313 27.6542 21.6359 25.2538 22.1413C24.6537 22.2676 24.401 22.3623 24.401 22.3623C24.401 22.3623 24.6221 22.0149 25.0327 21.8886C29.7703 20.2146 33.4025 26.7842 23.5166 29.4057C23.5482 29.3741 23.6429 29.2794 23.6745 29.1846Z" fill="#0074BD"> </path> <path d="M19.2206 0.25293C19.2206 0.25293 23.3266 4.35891 15.3357 10.6758C8.92404 15.7293 13.8828 18.6351 15.3357 21.9199C11.6087 18.5403 8.86088 15.5714 10.6928 12.792C13.3775 8.74919 20.863 6.79093 19.2206 0.25293Z" fill="#EA2D2E"> </path> <path d="M11.5455 39.6068C18.6521 40.049 29.5803 39.3541 29.833 35.9746C29.833 35.9746 29.3276 37.238 23.9583 38.2487C17.894 39.3858 10.4085 39.2594 5.95508 38.533C5.95508 38.5646 6.87103 39.3225 11.5455 39.6068Z" fill="#0074BD"> </path> </svg> <span> Java RS </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://mongodb.github.io/mongo-scala-driver/2.0/scaladoc/org/mongodb/scala/MongoCollection.html#dropIndex(indexName:String):org.mongodb.scala.SingleObservable[org.mongodb.scala.Completed]" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M28 29H0V1H28L14 15L28 29Z" fill="url(#:R35u9qcmqn9:paint0_linear_211_40588)"> </path> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":R35u9qcmqn9:paint0_linear_211_40588" x1="28" x2="8.34465e-07" y1="0.999999" y2="29"> <stop offset="0.00343514" stop-color="#E44857"> </stop> <stop offset="0.4689" stop-color="#C711E1"> </stop> <stop offset="1" stop-color="#7F52FF"> </stop> </lineargradient> </defs> </svg> <span> Kotlin Coroutine </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/languages/kotlin/kotlin-sync-driver/current/work-with-indexes/#delete-a-single-index" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M28 29H0V1H28L14 15L28 29Z" fill="url(#:R39u9qcmqn9:paint0_linear_211_40588)"> </path> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":R39u9qcmqn9:paint0_linear_211_40588" x1="28" x2="8.34465e-07" y1="0.999999" y2="29"> <stop offset="0.00343514" stop-color="#E44857"> </stop> <stop offset="0.4689" stop-color="#C711E1"> </stop> <stop offset="1" stop-color="#7F52FF"> </stop> </lineargradient> </defs> </svg> <span> Kotlin Sync </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/php-library/current/tutorial/indexes/#drop-indexes" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 700 301" width="24" x="0" xmlns="http://www.w3.org/2000/svg" y="0"> <defs> <clippath clippathunits="userSpaceOnUse" id="a"> <path d="M11.52 162C11.52 81.677 135.307 16.561 288 16.561S564.481 81.677 564.481 162c0 80.322-123.788 145.439-276.481 145.439-152.693 0-276.48-65.117-276.48-145.439"> </path> </clippath> <clippath clippathunits="userSpaceOnUse" id="c"> <path d="M0 324h576V0H0v324z"> </path> </clippath> <clippath clippathunits="userSpaceOnUse" id="d"> <path d="M0 324h576V0H0v324z"> </path> </clippath> <radialgradient cx="0" cy="0" fx="0" fy="0" gradienttransform="matrix(363.05789 0 0 -363.05789 177.52 256.307)" gradientunits="userSpaceOnUse" id="b" r="1" spreadmethod="pad"> <stop offset="0" stop-color="#aeb2d5"> </stop> <stop offset=".3" stop-color="#aeb2d5"> </stop> <stop offset=".75" stop-color="#484c89"> </stop> <stop offset="1" stop-color="#484c89"> </stop> </radialgradient> </defs> <g clip-path="url(#a)" transform="matrix(1.25 0 0 -1.25 -4.4 394.299)"> <path d="M11.52 162C11.52 81.677 135.307 16.561 288 16.561S564.481 81.677 564.481 162c0 80.322-123.788 145.439-276.481 145.439-152.693 0-276.48-65.117-276.48-145.439" fill="url(#b)"> </path> </g> <g clip-path="url(#c)" transform="matrix(1.25 0 0 -1.25 -4.4 394.299)"> <path d="M288 27.36c146.729 0 265.68 60.28 265.68 134.64 0 74.36-118.951 134.641-265.68 134.641S22.32 236.36 22.32 162.001C22.32 87.64 141.271 27.358 288 27.358" fill="#777bb3"> </path> </g> <g clip-path="url(#d)" transform="matrix(1.25 0 0 -1.25 -4.4 394.299)"> <path d="M161.734 145.307c12.065 0 21.072 2.225 26.771 6.61 5.638 4.342 9.532 11.863 11.573 22.354 1.903 9.806 1.178 16.653-2.154 20.348-3.407 3.774-10.773 5.688-21.893 5.688h-19.28l-10.69-55h15.673zm-63.063-67.75a2.998 2.998 0 00-2.944 3.572l28.328 145.75a3 3 0 002.945 2.428h61.054c19.188 0 33.47-5.21 42.447-15.487 9.025-10.331 11.812-24.772 8.283-42.921-1.436-7.394-3.906-14.261-7.34-20.41-3.44-6.154-7.985-11.85-13.512-16.93-6.616-6.191-14.104-10.681-22.236-13.323-8.003-2.607-18.28-3.93-30.548-3.93h-24.722l-7.06-36.321a3 3 0 00-2.944-2.428h-31.75z"> </path> <path d="M159.224 197.307h16.808c13.42 0 18.083-2.945 19.667-4.7 2.628-2.914 3.124-9.058 1.435-17.767-1.898-9.75-5.416-16.663-10.458-20.545-5.162-3.974-13.554-5.988-24.941-5.988H149.7l9.523 49zm28.83 35H127a6 6 0 01-5.89-4.855L92.784 81.702a6 6 0 015.889-7.144h31.75a6 6 0 015.89 4.854l6.588 33.895h22.249c12.582 0 23.174 1.372 31.479 4.077 8.54 2.775 16.399 7.48 23.354 13.984 5.752 5.292 10.49 11.232 14.08 17.657 3.59 6.427 6.17 13.594 7.668 21.302 3.715 19.104.697 34.402-8.97 45.466-9.571 10.958-24.613 16.514-44.705 16.514m-45.633-90h19.313c12.8 0 22.336 2.411 28.6 7.234 6.267 4.824 10.493 12.875 12.689 24.157 2.1 10.832 1.144 18.476-2.871 22.93-4.02 4.452-12.06 6.68-24.121 6.68h-21.754l-11.856-61m45.633 84c18.367 0 31.766-4.82 40.188-14.462 8.42-9.64 10.957-23.098 7.597-40.375-1.383-7.117-3.722-13.624-7.015-19.519-3.297-5.899-7.602-11.293-12.922-16.184-6.34-5.933-13.383-10.16-21.133-12.679-7.75-2.525-17.621-3.782-29.621-3.782h-27.196l-7.531-38.75h-31.75L127 226.307h61.055" fill="#fff"> </path> <path d="M311.583 116.307c-.896 0-1.745.4-2.314 1.092a2.994 2.994 0 00-.631 2.48l12.531 64.489c1.192 6.133.898 10.535-.827 12.395-1.056 1.137-4.228 3.044-13.607 3.044h-22.702l-15.755-81.072a3 3 0 00-2.945-2.428h-31.5a2.998 2.998 0 00-2.945 3.572l28.328 145.75a3 3 0 002.945 2.428h31.5a3 3 0 002.945-3.572l-6.836-35.178h24.422c18.605 0 31.221-3.28 38.569-10.028 7.49-6.884 9.827-17.891 6.947-32.72l-13.18-67.824a3 3 0 00-2.945-2.428h-32z"> </path> <path d="M293.661 271.057h-31.5a6 6 0 01-5.89-4.855l-28.328-145.75a5.998 5.998 0 015.89-7.145h31.5a6 6 0 015.89 4.855l15.283 78.645h20.23c9.362 0 11.327-2 11.406-2.086.568-.61 1.315-3.44.082-9.78l-12.53-64.49a5.998 5.998 0 015.89-7.144h32a6 6 0 015.89 4.855l13.178 67.825c3.093 15.921.447 27.864-7.86 35.5-7.929 7.281-21.209 10.82-40.6 10.82h-20.784l6.143 31.605a6.001 6.001 0 01-5.89 7.145m0-6l-7.53-38.75h28.061c17.657 0 29.836-3.082 36.54-9.238 6.702-6.16 8.71-16.14 6.031-29.938l-13.18-67.824h-32l12.531 64.488c1.426 7.336.902 12.34-1.574 15.008-2.477 2.668-7.746 4.004-15.805 4.004H281.56l-16.226-83.5h-31.5l28.328 145.75h31.5" fill="#fff"> </path> <path d="M409.55 145.307c12.065 0 21.072 2.225 26.77 6.61 5.639 4.34 9.533 11.862 11.575 22.354 1.903 9.806 1.178 16.653-2.155 20.348-3.407 3.774-10.773 5.688-21.893 5.688h-19.281l-10.69-55h15.674zm-63.062-67.75a2.999 2.999 0 00-2.945 3.572l28.328 145.75a3.002 3.002 0 002.946 2.428h61.053c19.189 0 33.47-5.21 42.448-15.487 9.025-10.33 11.81-24.771 8.283-42.921-1.438-7.394-3.907-14.261-7.342-20.41-3.44-6.154-7.984-11.85-13.511-16.93-6.616-6.191-14.104-10.681-22.236-13.323-8.003-2.607-18.281-3.93-30.548-3.93H388.24l-7.057-36.321a3.001 3.001 0 00-2.946-2.428h-31.75z"> </path> <path d="M407.04 197.307h16.807c13.421 0 18.083-2.945 19.667-4.7 2.63-2.914 3.125-9.058 1.435-17.766-1.898-9.75-5.417-16.664-10.458-20.546-5.162-3.974-13.554-5.988-24.94-5.988h-12.034l9.522 49zm28.83 35h-61.054a6 6 0 01-5.889-4.855L340.6 81.702a6 6 0 015.889-7.144h31.75a6 6 0 015.89 4.854l6.587 33.895h22.25c12.581 0 23.173 1.372 31.478 4.077 8.541 2.775 16.401 7.481 23.356 13.986 5.752 5.291 10.488 11.23 14.078 17.655 3.591 6.427 6.171 13.594 7.668 21.302 3.715 19.105.697 34.403-8.969 45.467-9.572 10.957-24.613 16.513-44.706 16.513m-45.632-90h19.312c12.801 0 22.336 2.411 28.601 7.234 6.267 4.824 10.492 12.875 12.688 24.157 2.102 10.832 1.145 18.476-2.87 22.93-4.02 4.452-12.06 6.68-24.122 6.68h-21.754l-11.855-61m45.632 84c18.367 0 31.766-4.82 40.188-14.462 8.422-9.64 10.957-23.098 7.597-40.375-1.383-7.117-3.722-13.624-7.015-19.519-3.297-5.899-7.602-11.293-12.922-16.184-6.34-5.933-13.383-10.16-21.133-12.679-7.75-2.525-17.62-3.782-29.62-3.782h-27.197l-7.53-38.75h-31.75l28.328 145.75h61.054" fill="#fff"> </path> </g> </svg> <span> PHP </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.rubydoc.info/gems/mongoid/3.1.6/Rails%2FMongoid:remove_indexes" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" preserveaspectratio="xMidYMid" viewbox="0 0 300 240" width="24" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id=":R3hu9qcmqn9:a" x1="84.75%" x2="58.254%" y1="111.399%" y2="64.584%"> <stop offset="0%" stop-color="#FB7655"> </stop> <stop offset="0%" stop-color="#FB7655"> </stop> <stop offset="41%" stop-color="#E42B1E"> </stop> <stop offset="99%" stop-color="#900"> </stop> <stop offset="100%" stop-color="#900"> </stop> </lineargradient> <lineargradient id=":R3hu9qcmqn9:b" x1="116.651%" x2="1.746%" y1="60.89%" y2="19.288%"> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="99%" stop-color="#911209"> </stop> <stop offset="100%" stop-color="#911209"> </stop> </lineargradient> <lineargradient id=":R3hu9qcmqn9:c" x1="75.774%" x2="38.978%" y1="219.327%" y2="7.829%"> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="99%" stop-color="#911209"> </stop> <stop offset="100%" stop-color="#911209"> </stop> </lineargradient> <lineargradient id=":R3hu9qcmqn9:d" x1="50.012%" x2="66.483%" y1="7.234%" y2="79.135%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="23%" stop-color="#E57252"> </stop> <stop offset="46%" stop-color="#DE3B20"> </stop> <stop offset="99%" stop-color="#A60003"> </stop> <stop offset="100%" stop-color="#A60003"> </stop> </lineargradient> <lineargradient id=":R3hu9qcmqn9:e" x1="46.174%" x2="49.932%" y1="16.348%" y2="83.047%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="23%" stop-color="#E4714E"> </stop> <stop offset="56%" stop-color="#BE1A0D"> </stop> <stop offset="99%" stop-color="#A80D00"> </stop> <stop offset="100%" stop-color="#A80D00"> </stop> </lineargradient> <lineargradient id=":R3hu9qcmqn9:f" x1="36.965%" x2="49.528%" y1="15.594%" y2="92.478%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="18%" stop-color="#E46342"> </stop> <stop offset="40%" stop-color="#C82410"> </stop> <stop offset="99%" stop-color="#A80D00"> </stop> <stop offset="100%" stop-color="#A80D00"> </stop> </lineargradient> <lineargradient id=":R3hu9qcmqn9:g" x1="13.609%" x2="85.764%" y1="58.346%" y2="-46.717%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="54%" stop-color="#C81F11"> </stop> <stop offset="99%" stop-color="#BF0905"> </stop> <stop offset="100%" stop-color="#BF0905"> </stop> </lineargradient> <lineargradient id=":R3hu9qcmqn9:h" x1="27.624%" x2="50.745%" y1="21.135%" y2="79.056%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="31%" stop-color="#DE4024"> </stop> <stop offset="99%" stop-color="#BF190B"> </stop> <stop offset="100%" stop-color="#BF190B"> </stop> </lineargradient> <lineargradient id=":R3hu9qcmqn9:i" x1="-20.667%" x2="104.242%" y1="122.282%" y2="-6.342%"> <stop offset="0%" stop-color="#BD0012"> </stop> <stop offset="0%" stop-color="#BD0012"> </stop> <stop offset="7%" stop-color="#FFF"> </stop> <stop offset="17%" stop-color="#FFF"> </stop> <stop offset="27%" stop-color="#C82F1C"> </stop> <stop offset="33%" stop-color="#820C01"> </stop> <stop offset="46%" stop-color="#A31601"> </stop> <stop offset="72%" stop-color="#B31301"> </stop> <stop offset="99%" stop-color="#E82609"> </stop> <stop offset="100%" stop-color="#E82609"> </stop> </lineargradient> <lineargradient id=":R3hu9qcmqn9:j" x1="58.792%" x2="11.964%" y1="65.205%" y2="50.128%"> <stop offset="0%" stop-color="#8C0C01"> </stop> <stop offset="0%" stop-color="#8C0C01"> </stop> <stop offset="54%" stop-color="#990C00"> </stop> <stop offset="99%" stop-color="#A80D0E"> </stop> <stop offset="100%" stop-color="#A80D0E"> </stop> </lineargradient> <lineargradient id=":R3hu9qcmqn9:k" x1="79.319%" x2="23.088%" y1="62.754%" y2="17.888%"> <stop offset="0%" stop-color="#7E110B"> </stop> <stop offset="0%" stop-color="#7E110B"> </stop> <stop offset="99%" stop-color="#9E0C00"> </stop> <stop offset="100%" stop-color="#9E0C00"> </stop> </lineargradient> <lineargradient id=":R3hu9qcmqn9:l" x1="92.88%" x2="59.841%" y1="74.122%" y2="39.704%"> <stop offset="0%" stop-color="#79130D"> </stop> <stop offset="0%" stop-color="#79130D"> </stop> <stop offset="99%" stop-color="#9E120B"> </stop> <stop offset="100%" stop-color="#9E120B"> </stop> </lineargradient> <lineargradient id=":R3hu9qcmqn9:o" x1="56.57%" x2="3.105%" y1="101.717%" y2="11.993%"> <stop offset="0%" stop-color="#8B2114"> </stop> <stop offset="0%" stop-color="#8B2114"> </stop> <stop offset="43%" stop-color="#9E100A"> </stop> <stop offset="99%" stop-color="#B3100C"> </stop> <stop offset="100%" stop-color="#B3100C"> </stop> </lineargradient> <lineargradient id=":R3hu9qcmqn9:p" x1="30.87%" x2="92.471%" y1="35.599%" y2="100.694%"> <stop offset="0%" stop-color="#B31000"> </stop> <stop offset="0%" stop-color="#B31000"> </stop> <stop offset="44%" stop-color="#910F08"> </stop> <stop offset="99%" stop-color="#791C12"> </stop> <stop offset="100%" stop-color="#791C12"> </stop> </lineargradient> <radialgradient cx="32.001%" cy="40.21%" fx="32.001%" fy="40.21%" id=":R3hu9qcmqn9:m" r="69.573%"> <stop offset="0%" stop-color="#A80D00"> </stop> <stop offset="0%" stop-color="#A80D00"> </stop> <stop offset="99%" stop-color="#7E0E08"> </stop> <stop offset="100%" stop-color="#7E0E08"> </stop> </radialgradient> <radialgradient cx="13.549%" cy="40.86%" fx="13.549%" fy="40.86%" id=":R3hu9qcmqn9:n" r="88.386%"> <stop offset="0%" stop-color="#A30C00"> </stop> <stop offset="0%" stop-color="#A30C00"> </stop> <stop offset="99%" stop-color="#800E08"> </stop> <stop offset="100%" stop-color="#800E08"> </stop> </radialgradient> </defs> <path d="M197.467 167.764l-145.52 86.41 188.422-12.787L254.88 51.393l-57.414 116.37z" fill="url(#:R3hu9qcmqn9:a)"> </path> <path d="M240.677 241.257L224.482 129.48l-44.113 58.25 60.308 53.528z" fill="url(#:R3hu9qcmqn9:b)"> </path> <path d="M240.896 241.257l-118.646-9.313-69.674 21.986 188.32-12.673z" fill="url(#:R3hu9qcmqn9:c)"> </path> <path d="M52.744 253.955l29.64-97.1L17.16 170.8l35.583 83.154z" fill="url(#:R3hu9qcmqn9:d)"> </path> <path d="M180.358 188.05L153.085 81.226l-78.047 73.16 105.32 33.666z" fill="url(#:R3hu9qcmqn9:e)"> </path> <path d="M248.693 82.73l-73.777-60.256-20.544 66.418 94.321-6.162z" fill="url(#:R3hu9qcmqn9:f)"> </path> <path d="M214.191.99L170.8 24.97 143.424.669l70.767.322z" fill="url(#:R3hu9qcmqn9:g)"> </path> <path d="M0 203.372l18.177-33.151-14.704-39.494L0 203.372z" fill="url(#:R3hu9qcmqn9:h)"> </path> <path d="M2.496 129.48l14.794 41.963 64.283-14.422 73.39-68.207 20.712-65.787L143.063 0 87.618 20.75c-17.469 16.248-51.366 48.396-52.588 49-1.21.618-22.384 40.639-32.534 59.73z" fill="#FFF"> </path> <path d="M54.442 54.094c37.86-37.538 86.667-59.716 105.397-40.818 18.72 18.898-1.132 64.823-38.992 102.349-37.86 37.525-86.062 60.925-104.78 42.027-18.73-18.885.515-66.032 38.375-103.558z" fill="url(#:R3hu9qcmqn9:i)"> </path> <path d="M52.744 253.916l29.408-97.409 97.665 31.376c-35.312 33.113-74.587 61.106-127.073 66.033z" fill="url(#:R3hu9qcmqn9:j)"> </path> <path d="M155.092 88.622l25.073 99.313c29.498-31.016 55.972-64.36 68.938-105.603l-94.01 6.29z" fill="url(#:R3hu9qcmqn9:k)"> </path> <path d="M248.847 82.833c10.035-30.282 12.35-73.725-34.966-81.791l-38.825 21.445 73.791 60.346z" fill="url(#:R3hu9qcmqn9:l)"> </path> <path d="M0 202.935c1.39 49.979 37.448 50.724 52.808 51.162l-35.48-82.86L0 202.935z" fill="#9E1209"> </path> <path d="M155.232 88.777c22.667 13.932 68.35 41.912 69.276 42.426 1.44.81 19.695-30.784 23.838-48.64l-93.114 6.214z" fill="url(#:R3hu9qcmqn9:m)"> </path> <path d="M82.113 156.507l39.313 75.848c23.246-12.607 41.45-27.967 58.121-44.42l-97.434-31.428z" fill="url(#:R3hu9qcmqn9:n)"> </path> <path d="M17.174 171.34l-5.57 66.328c10.51 14.357 24.97 15.605 40.136 14.486-10.973-27.311-32.894-81.92-34.566-80.814z" fill="url(#:R3hu9qcmqn9:o)"> </path> <path d="M174.826 22.654l78.1 10.96c-4.169-17.662-16.969-29.06-38.787-32.623l-39.313 21.663z" fill="url(#:R3hu9qcmqn9:p)"> </path> </svg> <span> Mongoid </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/drivers/rust/current/fundamentals/indexes/#remove-an-index" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 30 30" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_5454_14623)"> <path d="M15.2561 3.08398C8.56014 3.08398 3.11035 8.53634 3.11035 15.2297C3.11035 21.9231 8.56271 27.3755 15.2561 27.3755C21.9495 27.3755 27.4019 21.9231 27.4019 15.2297C27.4019 8.53634 21.9495 3.08398 15.2561 3.08398ZM15.2381 4.16315C15.4458 4.16853 15.6432 4.25509 15.7881 4.40437C15.9331 4.55365 16.0142 4.75384 16.0141 4.96225C16.0141 5.17418 15.9299 5.37744 15.7801 5.5273C15.6302 5.67715 15.4269 5.76134 15.215 5.76134C15.0031 5.76134 14.7998 5.67715 14.65 5.5273C14.5001 5.37744 14.4159 5.17418 14.4159 4.96225C14.4159 4.85533 14.4373 4.7495 14.4789 4.65101C14.5205 4.55252 14.5814 4.46338 14.6581 4.38887C14.7347 4.31435 14.8256 4.25598 14.9252 4.21721C15.0249 4.17844 15.1313 4.16006 15.2381 4.16315ZM17.0676 5.47871C18.4704 5.74146 19.7992 6.30644 20.9617 7.13439C22.1242 7.96235 23.0926 9.03345 23.7995 10.2733L22.8565 12.4008C22.6947 12.7682 22.8617 13.1999 23.2265 13.3643L25.0406 14.1686C25.0968 14.7356 25.1037 15.3065 25.0611 15.8747H24.0513C23.9511 15.8747 23.91 15.9415 23.91 16.0391V16.5016C23.91 17.5911 23.2959 17.83 22.7563 17.8891C22.2424 17.9482 21.6746 17.6733 21.6026 17.3598C21.2994 15.6563 20.7958 15.294 19.9993 14.6645C20.9885 14.0375 22.0163 13.11 22.0163 11.8715C22.0163 10.5328 21.099 9.69002 20.4747 9.27634C19.5959 8.69822 18.6247 8.5826 18.3626 8.5826H7.93063C9.37312 6.97114 11.3066 5.88021 13.4318 5.47871L14.6626 6.76857C14.9401 7.05891 15.4 7.07176 15.6903 6.79169L17.0676 5.47871ZM5.71063 11.3936C5.91853 11.3996 6.11589 11.4864 6.26079 11.6356C6.40568 11.7849 6.48669 11.9847 6.4866 12.1927C6.4866 12.4046 6.40241 12.6079 6.25255 12.7577C6.10269 12.9076 5.89944 12.9918 5.6875 12.9918C5.47557 12.9918 5.27232 12.9076 5.12246 12.7577C4.9726 12.6079 4.88841 12.4046 4.88841 12.1927C4.88836 12.0858 4.90977 11.9799 4.95137 11.8814C4.99297 11.7829 5.0539 11.6938 5.13057 11.6193C5.20724 11.5448 5.29809 11.4864 5.39772 11.4476C5.49736 11.4089 5.60376 11.3905 5.71063 11.3936ZM24.7631 11.4295C24.971 11.4356 25.1683 11.5224 25.3132 11.6716C25.4581 11.8208 25.5391 12.0206 25.539 12.2286C25.539 12.4406 25.4548 12.6438 25.305 12.7937C25.1551 12.9435 24.9519 13.0277 24.7399 13.0277C24.528 13.0277 24.3247 12.9435 24.1749 12.7937C24.025 12.6438 23.9408 12.4406 23.9408 12.2286C23.9408 12.1217 23.9622 12.0159 24.0038 11.9174C24.0454 11.8189 24.1063 11.7298 24.183 11.6553C24.2597 11.5807 24.3505 11.5224 24.4502 11.4836C24.5498 11.4448 24.6562 11.4264 24.7631 11.4295ZM7.21632 11.558H8.60896V17.8377H5.79799C5.45083 16.6186 5.34264 15.3439 5.47938 14.0838L7.20091 13.3181C7.56834 13.1536 7.73535 12.7245 7.57091 12.3571L7.21632 11.558ZM13.0284 11.6248H16.3456C16.5177 11.6248 17.5558 11.8227 17.5558 12.6012C17.5558 13.2461 16.7592 13.4774 16.104 13.4774H13.0258L13.0284 11.6248ZM13.0284 16.1368H15.5696C15.8008 16.1368 16.8106 16.2036 17.1318 17.4934C17.232 17.8891 17.4556 19.179 17.6072 19.5927C17.7588 20.0552 18.3729 20.9802 19.0281 20.9802H23.1751C22.8972 21.3524 22.5933 21.7044 22.2656 22.0336L20.5774 21.6713C20.1843 21.5866 19.7963 21.8384 19.7115 22.2315L19.3107 24.102C18.0217 24.6859 16.622 24.9848 15.2069 24.9781C13.7919 24.9714 12.395 24.6595 11.1116 24.0635L10.7108 22.1929C10.626 21.7998 10.2406 21.548 9.84743 21.6328L8.19528 21.9874C7.88869 21.6711 7.6037 21.3346 7.34223 20.9802H15.3769C15.4668 20.9802 15.5285 20.9647 15.5285 20.88V18.0381C15.5285 17.9559 15.4668 17.9379 15.3769 17.9379H13.0258L13.0284 16.1368ZM9.3207 22.6452C9.5286 22.6512 9.72596 22.738 9.87085 22.8872C10.0157 23.0364 10.0968 23.2363 10.0967 23.4443C10.0967 23.6562 10.0125 23.8594 9.86262 24.0093C9.71276 24.1592 9.50951 24.2434 9.29757 24.2434C9.08564 24.2434 8.88239 24.1592 8.73253 24.0093C8.58267 23.8594 8.49848 23.6562 8.49848 23.4443C8.49843 23.3373 8.51984 23.2315 8.56144 23.133C8.60303 23.0345 8.66397 22.9454 8.74064 22.8709C8.81731 22.7964 8.90815 22.738 9.00779 22.6992C9.10743 22.6605 9.21383 22.6421 9.3207 22.6452ZM21.153 22.6811C21.3609 22.6872 21.5583 22.774 21.7031 22.9232C21.848 23.0724 21.929 23.2722 21.929 23.4802C21.929 23.6922 21.8448 23.8954 21.6949 24.0453C21.5451 24.1951 21.3418 24.2793 21.1299 24.2793C20.9179 24.2793 20.7147 24.1951 20.5648 24.0453C20.415 23.8954 20.3308 23.6922 20.3308 23.4802C20.3307 23.3733 20.3521 23.2675 20.3937 23.169C20.4353 23.0705 20.4963 22.9814 20.5729 22.9068C20.6496 22.8323 20.7404 22.774 20.8401 22.7352C20.9397 22.6964 21.0461 22.678 21.153 22.6811Z" fill="black"> </path> <path clip-rule="evenodd" d="M26.7232 15.2304C26.7232 18.2717 25.515 21.1885 23.3645 23.3391C21.2139 25.4896 18.2971 26.6978 15.2558 26.6978C12.2144 26.6978 9.29761 25.4896 7.14705 23.3391C4.99649 21.1885 3.78832 18.2717 3.78832 15.2304C3.78832 12.189 4.99649 9.27222 7.14705 7.12166C9.29761 4.9711 12.2144 3.76293 15.2558 3.76293C18.2971 3.76293 21.2139 4.9711 23.3645 7.12166C25.515 9.27222 26.7232 12.189 26.7232 15.2304ZM26.5073 14.1229L28.2957 15.2304L26.5073 16.3378L28.0439 17.7741L26.0757 18.5115L27.3039 20.2202L25.2252 20.5594L26.0988 22.4762L23.9944 22.4017L24.4775 24.4521L22.4271 23.969L22.5016 26.0734L20.5848 25.1998L20.2456 27.2785L18.5369 26.0503L17.7995 28.0185L16.3632 26.482L15.2558 28.2703L14.1483 26.482L12.712 28.0185L11.9746 26.0503L10.2659 27.2785L9.92672 25.1998L8.00992 26.0734L8.08443 23.969L6.03401 24.4521L6.51707 22.4017L4.4127 22.4762L5.28631 20.5594L3.20763 20.2202L4.43582 18.5115L2.46763 17.7741L4.00415 16.3378L2.21582 15.2304L4.00415 14.1229L2.46763 12.6866L4.43582 11.9492L3.20763 10.2405L5.28631 9.90133L4.4127 7.98453L6.51707 8.05904L6.03401 6.00862L8.08443 6.49168L8.00992 4.3873L9.92672 5.26092L10.2659 3.18223L11.9746 4.41043L12.712 2.44224L14.1483 3.97876L15.2558 2.19043L16.3632 3.97876L17.7995 2.44224L18.5369 4.41043L20.2456 3.18223L20.5848 5.26092L22.5016 4.3873L22.4271 6.49168L24.4775 6.00862L23.9944 8.05904L26.0988 7.98453L25.2252 9.90133L27.3039 10.2405L26.0757 11.9492L28.0439 12.6866L26.5073 14.1229Z" fill="black" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"> </path> </g> <defs> <clippath id="clip0_5454_14623"> <rect fill="black" height="30" width="30"> </rect> </clippath> </defs> </svg> <span> Rust </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://mongodb.github.io/mongo-scala-driver/2.0/scaladoc/org/mongodb/scala/MongoCollection.html#dropIndex(indexName:String):org.mongodb.scala.SingleObservable[org.mongodb.scala.Completed]" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 70 70" width="24" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id=":R3pu9qcmqn9:aaa" x1=".006%" x2="96.837%" y1="49.998%" y2="49.998%"> <stop offset="0%" stop-color="#CD413F"> </stop> <stop offset="75.091%" stop-color="#CD4543"> </stop> <stop offset="100%" stop-color="#D04543"> </stop> </lineargradient> </defs> <g fill="none" fill-rule="nonzero"> <path d="M13 39v5c0 .843 17.73 2.255 29.28 5 5.582-1.327 9.72-2.966 9.72-5v-5c0-2.034-4.138-3.673-9.72-5C30.73 36.745 13 38.157 13 39M13 20v5c0 .843 17.73 2.255 29.28 5 5.582-1.327 9.72-2.966 9.72-5v-5c0-2.034-4.138-3.673-9.72-5C30.73 17.745 13 19.157 13 20" fill="#731818"> </path> <g fill="url(#:R3pu9qcmqn9:aaa)" transform="translate(13)"> <path d="M0 29.53v14.766c0-1.232 39-3.692 39-9.844V19.686c0 6.152-39 8.612-39 9.844M0 9.843V24.61c0-1.231 39-3.691 39-9.843V0C39 6.152 0 8.612 0 9.843M0 49.216v14.766c0-1.231 39-3.691 39-9.843V39.373c0 6.151-39 8.612-39 9.843"> </path> </g> </g> </svg> <span> Scala </span> </a> </div> <button class="leafygreen-ui-ki2t97"> Show all <svg aria-label="Chevron Down Icon" class="" fill="none" height="16" role="img" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M1.636 5.364a1 1 0 0 0 0 1.414l4.95 4.95.707.707a1 1 0 0 0 1.414 0l.707-.707 4.95-4.95a1 1 0 0 0 0-1.414l-.707-.707a1 1 0 0 0-1.414 0L8 8.899 3.757 4.657a1 1 0 0 0-1.414 0l-.707.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </button> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex(index) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.collection.dropIndex" 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-method-db.collection.dropIndex"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Drops or removes the specified index from a collection. </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"> You cannot drop the default index on the <code class="leafygreen-ui-1l06pbn"> _id </code> field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot specify <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.dropIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex("*") </code> </span> </a> to drop all non- <code class="leafygreen-ui-1l06pbn"> _id </code> indexes. Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.dropIndexes/#mongodb-method-db.collection.dropIndexes"> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndexes() </code> </a> instead. </p> </li> </ul> </div> </div> <p class="leafygreen-ui-1kp3ins"> To get the index name or the index specification document for the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.dropIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </span> </a> method, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.getIndexes/#mongodb-method-db.collection.getIndexes"> <code class="leafygreen-ui-1l06pbn"> db.collection.getIndexes() </code> </a> method. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.dropIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </span> </a> method takes the following parameter: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> index </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string or document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Required. Specifies the index to drop. You can specify the index either by the index name or by the index specification document. </p> <p class="leafygreen-ui-1kp3ins"> To drop a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-type-text"> text </a> index, specify the index name. </p> <p class="leafygreen-ui-1kp3ins"> You cannot specify <code class="leafygreen-ui-1l06pbn"> "*" </code> to drop all non- <code class="leafygreen-ui-1l06pbn"> _id </code> indexes. Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.dropIndexes/#mongodb-method-db.collection.dropIndexes"> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndexes() </code> </a> instead. </p> <p class="leafygreen-ui-1kp3ins"> If an index specified to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.dropIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </span> </a> is still building, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.dropIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </span> </a> attempts to stop the in-progress build. Stopping an index build has the same effect as dropping the built index. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-dropIndex-method-index-builds" target="_self"> <span> Stop In-Progress Index Builds </span> </a> for more complete documentation. </p> </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.2, you can use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.dropIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </span> </a> to drop existing indexes on the same collection even if there is a build in progress on another index. In earlier versions, attempting to drop a different index during an in-progress index build results in a <code class="leafygreen-ui-1l06pbn"> BackgroundOperationInProgressForNamespace </code> error. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Resource Locking <a class="headerlink leafygreen-ui-1kepx47" href="#resource-locking" 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="resource-locking"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.dropIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </span> </a> obtains an exclusive lock on the specified collection for the duration of the operation. All subsequent operations on the collection must wait until <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.dropIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </span> </a> releases the lock. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-dropIndex-method-index-builds"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Stop In-Progress Index Builds <a class="headerlink leafygreen-ui-1kepx47" href="#stop-in-progress-index-builds" 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="stop-in-progress-index-builds"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If an index specified to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.dropIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </span> </a> is still building, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.dropIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </span> </a> attempts to stop the in-progress build. Stopping an index build has the same effect as dropping the built index. </p> <p class="leafygreen-ui-1kp3ins"> For replica sets, run <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.dropIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </span> </a> on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> . The primary stops the index build and creates an associated "abortIndexBuild" <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> entry. Secondaries which replicate the "abortIndexBuild" oplog entry stop the in-progress index build and discard the build job. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-creation/#std-label-index-build-process"> Index Build Process </a> for detailed documentation on the index build process. </p> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-dbcommand-dbcmd.currentOp"> <code class="leafygreen-ui-1l06pbn"> currentOp </code> </a> to identify the index builds associated with a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createIndexes/#mongodb-dbcommand-dbcmd.createIndexes"> <code class="leafygreen-ui-1l06pbn"> createIndexes </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndexes/#mongodb-method-db.collection.createIndexes"> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </a> operation. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#std-label-currentOp-cmd-index-creation"> Active Indexing Operations </a> for an example. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Hidden Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#hidden-indexes" 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="hidden-indexes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB offers the ability to hide or unhide indexes from the query planner. By hiding an index from the planner, you can evaluate the potential impact of dropping an index without actually dropping the index. </p> <p class="leafygreen-ui-1kp3ins"> If after the evaluation, the user decides to drop the index, you can drop the hidden index; i.e. you do not need to unhide it first to drop it. </p> <p class="leafygreen-ui-1kp3ins"> If, however, the impact is negative, the user can unhide the index instead of having to recreate a dropped index. And because indexes are fully maintained while hidden, the indexes are immediately available for use once unhidden. </p> <p class="leafygreen-ui-1kp3ins"> For more information on hidden indexes, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-hidden/"> Hidden Indexes <!-- --> . </a> </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Consider a <code class="leafygreen-ui-1l06pbn"> pets </code> collection. Calling the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.getIndexes/#mongodb-method-db.collection.getIndexes"> <code class="leafygreen-ui-1l06pbn"> db.collection.getIndexes() </code> </a> method on the <code class="leafygreen-ui-1l06pbn"> pets </code> collection returns the following indexes: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n {\n \"v\" : 2,\n \"key\" : {\n \"_id\" : 1\n },\n \"name\" : \"_id_\"\n },\n {\n \"v\" : 2,\n \"key\" : {\n \"cat\" : -1\n },\n \"name\" : \"catIdx\"\n },\n {\n \"v\" : 2,\n \"key\" : {\n \"cat\" : 1,\n \"dog\" : -1\n },\n \"name\" : \"cat_1_dog_-1\"\n }\n]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"v"</span> <!-- -->: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"key"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"_id_"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"v"</span> <!-- -->: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"key"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"cat"</span> <!-- -->: <!-- -->-<span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"catIdx"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"v"</span> <!-- -->: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"key"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"cat"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dog"</span> <!-- -->: <!-- -->-<span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"cat_1_dog_-1"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The single field index on the field <code class="leafygreen-ui-1l06pbn"> cat </code> has the user-specified name of <code class="leafygreen-ui-1l06pbn"> catIdx </code> <a class="footnote-reference header-buffer" href="#footnote-index-name" id="ref-index-name-id1"> [ <!-- --> 1 <!-- --> ] </a> and the index specification document of <code class="leafygreen-ui-1l06pbn"> { "cat" : -1 } </code> . </p> <p class="leafygreen-ui-1kp3ins"> To drop the index <code class="leafygreen-ui-1l06pbn"> catIdx </code> , you can use either the index name: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.pets.dropIndex( \"catIdx\" )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">pets</span>.<span class="lg-highlight-title lg-highlight-function">dropIndex</span>( <span class="lg-highlight-string">"catIdx"</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"> Or you can use the index specification document <code class="leafygreen-ui-1l06pbn"> { "cat" : -1 } </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.pets.dropIndex( { \"cat\" : -1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">pets</span>.<span class="lg-highlight-title lg-highlight-function">dropIndex</span>( <!-- -->{ <span class="lg-highlight-string">"cat"</span> <!-- -->: <!-- -->-<span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <table class="header-buffer leafygreen-ui-rbqgrl" frame="void" id="footnote-index-name" rules="none"> <colgroup> <col/> </colgroup> <tbody valign="top"> <tr> <td class="leafygreen-ui-17r2xs0"> [ <a href="#ref-index-name-id1"> 1 </a> ] </td> <td class="leafygreen-ui-17r2xs0"> <!-- --> During index creation, if the user does <strong> not </strong> specify an index name, the system generates the name by concatenating the index key field and value with an underscore, e.g. <code class="leafygreen-ui-1l06pbn"> cat_1 </code> . </td> </tr> </tbody> </table> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/rename-unsharded-replica-set/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Rename a Self-Managed Replica Set <a class="headerlink leafygreen-ui-1kepx47" href="#rename-a-self-managed-replica-set" 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="rename-a-self-managed-replica-set"> </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="#prerequisites" target="_self"> <span> Prerequisites </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#procedure" target="_self"> <span> Procedure </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> To rename a replica set, you must shut down all members of the replica set, then configure each member's <code class="leafygreen-ui-1l06pbn"> local </code> database with the new replica set name. </p> <p class="leafygreen-ui-1kp3ins"> This procedure requires downtime. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Prerequisites <a class="headerlink leafygreen-ui-1kepx47" href="#prerequisites" 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="prerequisites"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Ensure that your replica set is not sharded. The renaming procedure is for unsharded replica sets only. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Before renaming a replica set, perform a full <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/backups/#std-label-backup-methods"> backup of your MongoDB deployment <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-authentication"> authentication </a> is enabled, ensure that your <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/#std-label-roles"> user role </a> has <code class="leafygreen-ui-1l06pbn"> find </code> , <code class="leafygreen-ui-1l06pbn"> insert </code> , and <code class="leafygreen-ui-1l06pbn"> remove </code> privileges on the <code class="leafygreen-ui-1l06pbn"> system.replset </code> collection in each member's <code class="leafygreen-ui-1l06pbn"> local </code> database. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can view the privileges for a role by issuing the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/rolesInfo/#mongodb-dbcommand-dbcmd.rolesInfo"> <code class="leafygreen-ui-1l06pbn"> rolesInfo </code> </a> command with the <code class="leafygreen-ui-1l06pbn"> showPrivileges </code> and <code class="leafygreen-ui-1l06pbn"> showBuiltinRoles </code> fields both set to <code class="leafygreen-ui-1l06pbn"> true </code> . </p> </div> </div> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#procedure" 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="procedure"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Shut down replica set members.Follow the procedure in Stop a Replica Set\nto confirm that replica set members are\nshut down.This step requires downtime as all replica members will need to be\nshut down."},{"@type":"HowToStep","text":"Rename the replica set.Perform the following steps for each replica set member:Start the replica set member on a different port without the\n--replSet option.Update the replica set name.If using a configuration file, set\nreplication.replSetName\nto the new name.If using the mongod startup command with\nthe --replSet option, note down the\nnew replica set name for use in step f.Connect to the replica set member.Update the replica set name in the local database with the following commands:Shut down the replica set\nmember.If you are using Ops Manager, you must stop Ops Manager\nfrom managing the replica set before you shut down the\nreplica set member. For more information on this procedure,\nsee Remove a Process from Ops ManagementStart the replica set member on its original port.If using a configuration file, ensure that\nreplication.replSetName is\nset to the new replica set name.If using the mongod startup command with\nthe --replSet option, pass the new\nname of the replica set to the\n--replSet option."}],"name":"Procedure","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Shut down replica set members. <a class="headerlink leafygreen-ui-1kepx47" href="#shut-down-replica-set-members" 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="shut-down-replica-set-members"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Follow the procedure in <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-mongodb-processes/#std-label-stop-replica-set"> Stop a Replica Set </a> to confirm that replica set members are <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-mongodb-processes/#std-label-terminate-mongod-processes"> shut down <!-- --> . </a> </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This step requires downtime as all replica members will need to be shut down. </p> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Rename the replica set. <a class="headerlink leafygreen-ui-1kepx47" href="#rename-the-replica-set" 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="rename-the-replica-set"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Perform the following steps for each replica set member: </p> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Start the replica set member on a different port without the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--replSet"> <code class="leafygreen-ui-1l06pbn"> --replSet </code> </a> option. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Update the replica set name. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If using a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#std-label-conf-file"> configuration file </a> , set <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> </a> to the new name. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> startup command with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--replSet"> <code class="leafygreen-ui-1l06pbn"> --replSet </code> </a> option, note down the new replica set name for use in step f. </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Connect to the replica set member. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Update the replica set name in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/local-database/#std-label-replica-set-local-database"> local database </a> with the following commands: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"/* Set `newId` to the new replica set name */\nvar newId = '&lt;new&gt;'\n\nvar doc = db.getSiblingDB(\"local\").system.replset.findOne()\nvar oldId = doc._id\ndoc._id = newId\ndb.getSiblingDB(\"local\").system.replset.insertOne(doc)\ndb.getSiblingDB(\"local\").system.replset.deleteOne({_id: oldId})","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">/* Set `newId`</span><span class="lg-highlight-comment"> to the new </span><span class="lg-highlight-comment">replica set name */</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> newId <!-- -->= <span class="lg-highlight-string">'&lt;new replica set name&gt;'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> doc <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<span class="lg-highlight-string">"local"</span>).<span class="lg-highlight-property">system</span>.<span class="lg-highlight-property">replset</span>.<span class="lg-highlight-title lg-highlight-function">findOne</span>(<!-- -->)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> oldId <!-- -->= <!-- -->doc.<span class="lg-highlight-property">_id</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">doc.<span class="lg-highlight-property">_id</span> <!-- -->= <!-- -->newId</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<span class="lg-highlight-string">"local"</span>).<span class="lg-highlight-property">system</span>.<span class="lg-highlight-property">replset</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>(<!-- -->doc)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<span class="lg-highlight-string">"local"</span>).<span class="lg-highlight-property">system</span>.<span class="lg-highlight-property">replset</span>.<span class="lg-highlight-title lg-highlight-function">deleteOne</span>(<!-- -->{<span class="lg-highlight-attr">_id</span>: <!-- -->oldId})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-mongodb-processes/#std-label-terminate-mongod-processes"> Shut down </a> the replica set member. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Ops Manager </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If you are using Ops Manager, you must stop Ops Manager from managing the replica set before you shut down the replica set member. For more information on this procedure, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/ops-manager/current/tutorial/unmanage-deployment/#remove-a-process-from-management" target="_self"> <span> Remove a Process from Ops Management </span> </a> </p> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Start the replica set member on its original port. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If using a configuration file, ensure that <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> </a> is set to the new replica set name. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> startup command with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--replSet"> <code class="leafygreen-ui-1l06pbn"> --replSet </code> </a> option, pass the new name of the replica set to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--replSet"> <code class="leafygreen-ui-1l06pbn"> --replSet </code> </a> option. </p> </li> </ul> </li> </ol> </section> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/core/timeseries/timeseries-procedures/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Create and Query a Time Series Collection <a class="headerlink leafygreen-ui-1kepx47" href="#create-and-query-a-time-series-collection" 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-and-query-a-time-series-collection"> </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="#create-a-time-series-collection" target="_self"> <span> Create a Time Series Collection </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#insert-measurements-into-a-time-series-collection" target="_self"> <span> Insert Measurements into a Time Series Collection </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#query-a-time-series-collection" target="_self"> <span> Query a Time Series Collection </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#run-aggregations-on-a-time-series-collection" target="_self"> <span> Run Aggregations on a Time Series Collection </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> This page shows how to create and query a time series collection, with code examples. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Feature Compatibility Version Requirement </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can only create time series collections on a system with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-view-fcv"> featureCompatibilityVersion </a> set to 5.0 or greater. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-manual-timeseries-collection-create"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Create a Time Series Collection <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-time-series-collection" 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-time-series-collection"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Define the timeField as the field that contains time data and\nthe metaField as the field that contains metadata:In this example, timestamp is the name of the\ntimeField and metadata is the name of the metaField.\nThe value of the timestamp field must be a date type.Choosing the right metaField for your collection optimizes\nboth storage and query performance. For more information on\nmetaField selection and best practices, see\nmetaFields."},{"@type":"HowToStep","text":"Define the time interval for each bucket of data using one\nof the two approaches below:After creation, you can modify granularity or bucket\ndefinitions using the collMod method. However,\nyou can only increase the time span covered by each bucket. You\ncannot decrease it.Define a granularity field:For more detailed information on selecting a granularity\nvalue, see Granularity Considerations.ORIn MongoDB 6.3 and higher, you can define\nbucketMaxSpanSeconds and bucketRoundingSeconds fields.\nBoth values must be the same:"},{"@type":"HowToStep","text":"Optionally, set expireAfterSeconds to expire documents\nwhen the value of the timeField is at least that old:"},{"@type":"HowToStep","text":"Create the collection using either the\ndb.createCollection() method or the create\ncommand. The follow example uses the\ndb.createCollection() method to create a weather\ntime series collection:"}],"name":"Create a Time Series Collection","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-qum8nr eccljxs0"> <div class="css-vq8pj5 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-18jxsvu e1ckbxcu2"> 1 </div> </div> <div class="css-clrhqf"> <section> <p class="leafygreen-ui-1kp3ins"> Define the <code class="leafygreen-ui-1l06pbn"> timeField </code> as the field that contains time data and the <code class="leafygreen-ui-1l06pbn"> metaField </code> as the field that contains metadata: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n timeField: \"timestamp\",\n metaField: \"metadata\"\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeField</span>: <span class="lg-highlight-string">"timestamp"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metaField</span>: <span class="lg-highlight-string">"metadata"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In this example, <code class="leafygreen-ui-1l06pbn"> timestamp </code> is the name of the <code class="leafygreen-ui-1l06pbn"> timeField </code> and <code class="leafygreen-ui-1l06pbn"> metadata </code> is the name of the <code class="leafygreen-ui-1l06pbn"> metaField </code> . The value of the <code class="leafygreen-ui-1l06pbn"> timestamp </code> field must be a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-date"> date </a> type. </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"> Choosing the right <code class="leafygreen-ui-1l06pbn"> metaField </code> for your collection optimizes both storage and query performance. For more information on <code class="leafygreen-ui-1l06pbn"> metaField </code> selection and best practices, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-timeseries-collections-metafield"> metaFields <!-- --> . </a> </p> </div> </div> </section> </div> </div> <div class="css-vq8pj5 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-18jxsvu e1ckbxcu2"> 2 </div> </div> <div class="css-clrhqf"> <section> <p class="leafygreen-ui-1kp3ins"> Define the time interval for each bucket of data using one of the two approaches below: </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Changing Time Series Intervals </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> After creation, you can modify granularity or bucket definitions using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> method. However, you can only increase the time span covered by each bucket. You cannot decrease it. </p> </div> </div> <ol class="leafygreen-ui-rioki0" type="A"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Define a <code class="leafygreen-ui-1l06pbn"> granularity </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n granularity: \"seconds\"\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">granularity</span>: <span class="lg-highlight-string">"seconds"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more detailed information on selecting a <code class="leafygreen-ui-1l06pbn"> granularity </code> value, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-considerations/#std-label-timeseries-granularity-considerations"> Granularity Considerations <!-- --> . </a> </p> </li> </ol> <p class="leafygreen-ui-1kp3ins"> <strong> OR </strong> </p> <ol class="leafygreen-ui-rioki0" start="2" type="A"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In MongoDB 6.3 and higher, you can define <code class="leafygreen-ui-1l06pbn"> bucketMaxSpanSeconds </code> and <code class="leafygreen-ui-1l06pbn"> bucketRoundingSeconds </code> fields. Both values must be the same: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n bucketMaxSpanSeconds: \"300\",\n bucketRoundingSeconds: \"300\"\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bucketMaxSpanSeconds</span>: <span class="lg-highlight-string">"300"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bucketRoundingSeconds</span>: <span class="lg-highlight-string">"300"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </li> </ol> </section> </div> </div> <div class="css-vq8pj5 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-18jxsvu e1ckbxcu2"> 3 </div> </div> <div class="css-clrhqf"> <section> <p class="leafygreen-ui-1kp3ins"> Optionally, set <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> to expire documents when the value of the <code class="leafygreen-ui-1l06pbn"> timeField </code> is at least that old: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n expireAfterSeconds: 86400\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">expireAfterSeconds</span>: <span class="lg-highlight-number">86400</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </div> </div> <div class="css-vq8pj5 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-18jxsvu e1ckbxcu2"> 4 </div> </div> <div class="css-clrhqf"> <section> <p class="leafygreen-ui-1kp3ins"> Create the collection using either the <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> method or the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/create/#mongodb-dbcommand-dbcmd.create"> <code class="leafygreen-ui-1l06pbn"> create </code> </a> command. The follow example uses the <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> method to create a <code class="leafygreen-ui-1l06pbn"> weather </code> time series collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection(\n \"weather\",\n {\n timeseries: {\n timeField: \"timestamp\",\n metaField: \"metadata\",\n granularity: \"seconds\"\n },\n expireAfterSeconds: 86400\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"weather"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeseries</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeField</span>: <span class="lg-highlight-string">"timestamp"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metaField</span>: <span class="lg-highlight-string">"metadata"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">granularity</span>: <span class="lg-highlight-string">"seconds"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">expireAfterSeconds</span>: <span class="lg-highlight-number">86400</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-time-series-fields"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Time Series Field Reference <a class="headerlink leafygreen-ui-1kepx47" href="#time-series-field-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="time-series-field-reference"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> A time series collection includes the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:40%"/> <col style="width:20%"/> <col style="width:60%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timeseries.timeField </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Required. The name of the field which contains the date in each time series document. Documents in a time series collection must have a valid BSON date as the value for the <code class="leafygreen-ui-1l06pbn"> timeField </code> . </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timeseries.metaField </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The name of the field which contains metadata in each time series document. The metadata in the specified field should be data that is used to label a unique series of documents. The metadata should rarely, if ever, change The name of the specified field may not be <code class="leafygreen-ui-1l06pbn"> _id </code> or the same as the <code class="leafygreen-ui-1l06pbn"> timeseries.timeField </code> . The field can be of any data type. </p> <p class="leafygreen-ui-1kp3ins"> Although the <code class="leafygreen-ui-1l06pbn"> metaField </code> field is optional, using metadata can improve query optimization. For example, MongoDB automatically <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-secondary-index/#std-label-timeseries-add-secondary-index"> creates a compound index </a> on the <code class="leafygreen-ui-1l06pbn"> metaField </code> and <code class="leafygreen-ui-1l06pbn"> timeField </code> fields for new collections. If you do not provide a value for this field, the data is bucketed solely based on time. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timeseries.granularity </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Do not use if setting <code class="leafygreen-ui-1l06pbn"> bucketRoundingSeconds </code> and <code class="leafygreen-ui-1l06pbn"> bucketMaxSpanSeconds </code> . </p> <p class="leafygreen-ui-1kp3ins"> Possible values are <code class="leafygreen-ui-1l06pbn"> seconds </code> (default), <code class="leafygreen-ui-1l06pbn"> minutes </code> , and <code class="leafygreen-ui-1l06pbn"> hours </code> . </p> <p class="leafygreen-ui-1kp3ins"> Set <code class="leafygreen-ui-1l06pbn"> granularity </code> to the value that most closely matches the time between consecutive incoming timestamps. This improves performance by optimizing how MongoDB stores data in the collection. </p> <p class="leafygreen-ui-1kp3ins"> For more information on granularity and bucket intervals, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-granularity/#std-label-timeseries-granularity"> Set Granularity for Time Series Data <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timeseries.bucketMaxSpanSeconds </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Use with <code class="leafygreen-ui-1l06pbn"> bucketRoundingSeconds </code> as an alternative to <code class="leafygreen-ui-1l06pbn"> granularity </code> . Sets the maximum time between timestamps in the same bucket. </p> <p class="leafygreen-ui-1kp3ins"> Possible values are 1-31536000. </p> <div> <p> <em> New <!-- --> in version <!-- --> 6.3 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timeseries.bucketRoundingSeconds </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Use with <code class="leafygreen-ui-1l06pbn"> bucketMaxSpanSeconds </code> as an alternative to <code class="leafygreen-ui-1l06pbn"> granularity </code> . Must be equal to <code class="leafygreen-ui-1l06pbn"> bucketMaxSpanSeconds </code> . </p> <p class="leafygreen-ui-1kp3ins"> When a document requires a new bucket, MongoDB rounds down the document's timestamp value by this interval to set the minimum time for the bucket. </p> <div> <p> <em> New <!-- --> in version <!-- --> 6.3 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. Enable the automatic deletion of documents in a time series collection by specifying the number of seconds after which documents expire. MongoDB deletes expired documents automatically. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-automatic-removal/#std-label-manual-timeseries-automatic-removal"> Set up Automatic Removal for Time Series Collections (TTL) </a> for more information. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> Other allowed options that are not specific to time series collections are: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> storageEngine </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> indexOptionDefaults </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> collation </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> writeConcern </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> comment </code> </p> </li> </ul> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <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> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/create/#mongodb-dbcommand-dbcmd.create"> <code class="leafygreen-ui-1l06pbn"> create </code> . </a> </p> </div> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Insert Measurements into a Time Series Collection <a class="headerlink leafygreen-ui-1kepx47" href="#insert-measurements-into-a-time-series-collection" 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="insert-measurements-into-a-time-series-collection"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Each document you insert should contain a single measurement. To insert multiple documents at once, issue the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.weather.insertMany( [\n {\n metadata: { sensorId: 5578, type: \"temperature\" },\n timestamp: ISODate(\"2021-05-18T00:00:00.000Z\"),\n temp: 12\n },\n {\n metadata: { sensorId: 5578, type: \"temperature\" },\n timestamp: ISODate(\"2021-05-18T04:00:00.000Z\"),\n temp: 11\n },\n {\n metadata: { sensorId: 5578, type: \"temperature\" },\n timestamp: ISODate(\"2021-05-18T08:00:00.000Z\"),\n temp: 11\n },\n {\n metadata: { sensorId: 5578, type: \"temperature\" },\n timestamp: ISODate(\"2021-05-18T12:00:00.000Z\"),\n temp: 12\n },\n {\n metadata: { sensorId: 5578, type: \"temperature\" },\n timestamp: ISODate(\"2021-05-18T16:00:00.000Z\"),\n temp: 16\n },\n {\n metadata: { sensorId: 5578, type: \"temperature\" },\n timestamp: ISODate(\"2021-05-18T20:00:00.000Z\"),\n temp: 15\n },\n {\n metadata: { sensorId: 5578, type: \"temperature\" },\n timestamp: ISODate(\"2021-05-19T00:00:00.000Z\"),\n temp: 13\n },\n {\n metadata: { sensorId: 5578, type: \"temperature\" },\n timestamp: ISODate(\"2021-05-19T04:00:00.000Z\"),\n temp: 12\n },\n {\n metadata: { sensorId: 5578, type: \"temperature\" },\n timestamp: ISODate(\"2021-05-19T08:00:00.000Z\"),\n temp: 11\n },\n {\n metadata: { sensorId: 5578, type: \"temperature\" },\n timestamp: ISODate(\"2021-05-19T12:00:00.000Z\"),\n temp: 12\n },\n {\n metadata: { sensorId: 5578, type: \"temperature\" },\n timestamp: ISODate(\"2021-05-19T16:00:00.000Z\"),\n temp: 17\n },\n {\n metadata: { sensorId: 5578, type: \"temperature\" },\n timestamp: ISODate(\"2021-05-19T20:00:00.000Z\"),\n temp: 12\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">weather</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metadata</span>: <!-- -->{ <span class="lg-highlight-attr">sensorId</span>: <span class="lg-highlight-number">5578</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"temperature"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-18T00:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">12</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metadata</span>: <!-- -->{ <span class="lg-highlight-attr">sensorId</span>: <span class="lg-highlight-number">5578</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"temperature"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-18T04:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">11</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metadata</span>: <!-- -->{ <span class="lg-highlight-attr">sensorId</span>: <span class="lg-highlight-number">5578</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"temperature"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-18T08:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">11</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metadata</span>: <!-- -->{ <span class="lg-highlight-attr">sensorId</span>: <span class="lg-highlight-number">5578</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"temperature"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-18T12:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">12</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metadata</span>: <!-- -->{ <span class="lg-highlight-attr">sensorId</span>: <span class="lg-highlight-number">5578</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"temperature"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-18T16:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">16</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metadata</span>: <!-- -->{ <span class="lg-highlight-attr">sensorId</span>: <span class="lg-highlight-number">5578</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"temperature"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-18T20:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">15</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metadata</span>: <!-- -->{ <span class="lg-highlight-attr">sensorId</span>: <span class="lg-highlight-number">5578</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"temperature"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-19T00:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">13</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metadata</span>: <!-- -->{ <span class="lg-highlight-attr">sensorId</span>: <span class="lg-highlight-number">5578</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"temperature"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-19T04:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">12</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metadata</span>: <!-- -->{ <span class="lg-highlight-attr">sensorId</span>: <span class="lg-highlight-number">5578</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"temperature"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-19T08:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">11</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metadata</span>: <!-- -->{ <span class="lg-highlight-attr">sensorId</span>: <span class="lg-highlight-number">5578</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"temperature"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-19T12:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">12</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metadata</span>: <!-- -->{ <span class="lg-highlight-attr">sensorId</span>: <span class="lg-highlight-number">5578</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"temperature"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-19T16:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">17</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metadata</span>: <!-- -->{ <span class="lg-highlight-attr">sensorId</span>: <span class="lg-highlight-number">5578</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"temperature"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-19T20:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">12</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To insert a single document, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.insertOne/#mongodb-method-db.collection.insertOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.insertOne() </code> </a> method. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Optimize Insert Performance </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To learn how to optimize inserts for large operations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-best-practices/#std-label-tsc-best-practice-optimize-inserts"> Inserts Best Practices <!-- --> . </a> </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-timeseries-query-example"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Query a Time Series Collection <a class="headerlink leafygreen-ui-1kepx47" href="#query-a-time-series-collection" 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="query-a-time-series-collection"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You query a time series collection the same way you query a standard MongoDB collection. </p> <p class="leafygreen-ui-1kp3ins"> To return one document from a time series collection, run: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.weather.findOne( {\n timestamp: ISODate(\"2021-05-18T00:00:00.000Z\")\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">weather</span>.<span class="lg-highlight-title lg-highlight-function">findOne</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-18T00:00:00.000Z"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Example output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n timestamp: ISODate(\"2021-05-18T00:00:00.000Z\"),\n metadata: { sensorId: 5578, type: 'temperature' },\n temp: 12,\n _id: ObjectId(\"62f11bbf1e52f124b84479ad\")\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-05-18T00:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metadata</span>: <!-- -->{ <span class="lg-highlight-attr">sensorId</span>: <span class="lg-highlight-number">5578</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">'temperature'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">12</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"62f11bbf1e52f124b84479ad"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on time series queries, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-best-practices/#std-label-tsc-best-practice-optimize-query-performance"> Query Best Practices <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Run Aggregations on a Time Series Collection <a class="headerlink leafygreen-ui-1kepx47" href="#run-aggregations-on-a-time-series-collection" 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="run-aggregations-on-a-time-series-collection"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> For additional query functionality, use an <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/aggregation-pipeline/#std-label-aggregation-pipeline"> aggregation pipeline </a> such as: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.weather.aggregate( [\n {\n $project: {\n date: {\n $dateToParts: { date: \"$timestamp\" }\n },\n temp: 1\n }\n },\n {\n $group: {\n _id: {\n date: {\n year: \"$date.year\",\n month: \"$date.month\",\n day: \"$date.day\"\n }\n },\n avgTmp: { $avg: \"$temp\" }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">weather</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$dateToParts</span>: <!-- -->{ <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-string">"$timestamp"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$group</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">year</span>: <span class="lg-highlight-string">"$date.year"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">month</span>: <span class="lg-highlight-string">"$date.month"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">day</span>: <span class="lg-highlight-string">"$date.day"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">avgTmp</span>: <!-- -->{ <span class="lg-highlight-attr">$avg</span>: <span class="lg-highlight-string">"$temp"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The example aggregation pipeline groups all documents by the date of the measurement and then returns the average of all temperature measurements that day: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":" {\n \"_id\" : {\n \"date\" : {\n \"year\" : 2021,\n \"month\" : 5,\n \"day\" : 18\n }\n },\n \"avgTmp\" : 12.714285714285714\n}\n{\n \"_id\" : {\n \"date\" : {\n \"year\" : 2021,\n \"month\" : 5,\n \"day\" : 19\n }\n },\n \"avgTmp\" : 13\n}"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "_id" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "date" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "year" : 2021,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "month" : 5,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "day" : 18</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "avgTmp" : 12.714285714285714</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "_id" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "date" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "year" : 2021,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "month" : 5,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "day" : 19</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "avgTmp" : 13</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/restore-replica-set-from-backup/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Restore a Self-Managed Replica Set from MongoDB Backups <a class="headerlink leafygreen-ui-1kepx47" href="#restore-a-self-managed-replica-set-from-mongodb-backups" 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="restore-a-self-managed-replica-set-from-mongodb-backups"> </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="#restore-database-into-a-single-node-replica-set" target="_self"> <span> Restore Database into a Single Node Replica Set </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#add-members-to-the-replica-set" target="_self"> <span> Add Members to the Replica Set </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> This procedure outlines the process for taking MongoDB data and restoring that data into a new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> . Use this approach for seeding test deployments from production backups or as part of disaster recovery. </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"> You <em> cannot </em> restore a single data set to three new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances and <strong> then </strong> create a replica set. If you copy the data set to each <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance and then create the replica set, MongoDB will force the secondaries to perform an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-initial-sync"> initial sync </a> . The procedures in this document describe the correct and efficient ways to deploy a restored replica set. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> You can also use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongorestore/#mongodb-binary-bin.mongorestore" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongorestore </code> </span> </a> to restore database files using data created with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongodump/#mongodb-binary-bin.mongodump" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongodump </code> </span> </a> . See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/backup-and-restore-tools/"> Back Up and Restore a Self-Managed Deployment with MongoDB Tools </a> for more information. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Restore Database into a Single Node Replica Set <a class="headerlink leafygreen-ui-1kepx47" href="#restore-database-into-a-single-node-replica-set" 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="restore-database-into-a-single-node-replica-set"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Obtain backup MongoDB Database files.The backup files may come from a file system snapshot. The MongoDB Cloud Manager\nproduces MongoDB database files for stored snapshots and point in time\nsnapshots.\nFor Ops Manager, an on-premise solution available in\nMongoDB Enterprise Advanced,\nsee also the Ops Manager Backup overview.For encrypted storage engines that\nuse AES256-GCM encryption mode, AES256-GCM requires that every\nprocess use a unique counter block value with the key.For encrypted storage engine\nconfigured with AES256-GCM cipher:Starting in 4.2, if you restore from files taken via \"hot\"\nbackup (i.e. the mongod is running), MongoDB\ncan detect \"dirty\" keys on startup and automatically rollover\nthe database key to avoid IV (Initialization Vector) reuse.However, if you restore from files taken via \"cold\" backup\n(i.e. the mongod is not running), MongoDB\ncannot detect \"dirty\" keys on startup, and reuse of IV voids\nconfidentiality and integrity guarantees.Starting in 4.2, to avoid the reuse of the keys after\nrestoring from a cold filesystem snapshot, MongoDB adds a new\ncommand-line option --eseDatabaseKeyRollover. When started with the\n--eseDatabaseKeyRollover option, the mongod\ninstance rolls over the database keys configured with\nAES256-GCM cipher and exits."},{"@type":"HowToStep","text":"Drop the local database if it exists in the backup.If you are restoring from a filesystem backup (or any backup with\nthe local database), drop the local database.Start a standalone mongod using the data files from the backup as the data path.You must also specify the same startup options that were used when the snapshot was created.Drop the local database.Connect mongosh to the mongod\ninstance and drop the local database.Shut down the standalone."},{"@type":"HowToStep","text":"Start a new single-node replica set.Start a mongod instance as a new single-node replica set.\nSpecify the path to the backup data files with --dbpath option\nand the replica set name with the --replSet option.\nFor config server replica set (CSRS),\ninclude the --configsvr option.\nInclude any other options as appropriate for your deployment.You must also specify the same startup options\nthat were used when the snapshot was created.If your replica set members are run on\ndifferent hosts or if you wish remote clients to connect to your\ninstance, you must specify the net.bindIp setting (or\n--bind_ip).Before you bind your instance to a publicly-accessible IP address,\nyou must secure your cluster from unauthorized access. For a complete\nlist of security recommendations, see\nSecurity Checklist for Self-Managed Deployments. At minimum, consider\nenabling authentication and hardening\nnetwork infrastructure.All MongoDB collections have\nUUIDs (Universally unique identifiers) by default. When\nMongoDB restores collections, the restored collections retain their\noriginal UUIDs. When restoring a collection where no UUID was\npresent, MongoDB generates a UUID for the restored collection.For more information on collection UUIDs, see Collections."},{"@type":"HowToStep","text":"Connect mongosh to the mongod instance.From the same machine where one of the mongod is running\n(in this tutorial, mongodb0.example.net), start\nmongosh. To connect to the mongod\nlistening to localhost on the default port of 27017, simply issue:Depending on your path, you may need to specify the path to the\nmongosh binary.If your mongod is not running on the default port, specify the\n--port option for mongosh."},{"@type":"HowToStep","text":"Initiate the new replica set.Use rs.initiate() on one and only one member of the replica set:MongoDB initiates a set that consists of the current member and that\nuses the default replica set configuration."}],"name":"Restore Database into a Single Node Replica Set","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Obtain backup MongoDB Database files. <a class="headerlink leafygreen-ui-1kepx47" href="#obtain-backup-mongodb-database-files" 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="obtain-backup-mongodb-database-files"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The backup files may come from a <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/backup-with-filesystem-snapshots/"> file system snapshot </a> . The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://cloud.mongodb.com/?tck=docs_server" target="_self"> <span> MongoDB Cloud Manager </span> </a> produces MongoDB database files for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/cloud-manager/tutorial/restore-from-snapshot/" target="_self"> <span> stored snapshots </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/cloud-manager/tutorial/restore-from-point-in-time-snapshot/" target="_self"> <span> point in time snapshots </span> </a> . For <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/products/mongodb-enterprise-advanced?tck=docs_server" target="_self"> <span> Ops Manager, an on-premise solution available in MongoDB Enterprise Advanced </span> </a> , see also the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/ops-manager/current/core/backup-overview/" target="_self"> <span> Ops Manager Backup overview <!-- --> . </span> </a> </p> <dl> <dt> Considerations for Encrypted Storage Engines </dt> <dd class="css-1ufxuu7"> For <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-encryption-at-rest/#std-label-encrypted-storage-engine"> encrypted storage engines </a> that use <code class="leafygreen-ui-1l06pbn"> AES256-GCM </code> encryption mode, <code class="leafygreen-ui-1l06pbn"> AES256-GCM </code> requires that every process use a unique counter block value with the key. <!-- --> For <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-encryption-at-rest/#std-label-encrypted-storage-engine"> encrypted storage engine </a> configured with <code class="leafygreen-ui-1l06pbn"> AES256-GCM </code> cipher: <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <dl> <dt> Restoring from Hot Backup </dt> <dd class="css-1ufxuu7"> Starting in 4.2, if you restore from files taken via "hot" backup (i.e. the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> is running), MongoDB can detect "dirty" keys on startup and automatically rollover the database key to avoid IV (Initialization Vector) reuse. </dd> </dl> </li> <li class="leafygreen-ui-d7p7b6"> <dl> <dt> Restoring from Cold Backup </dt> <dd class="css-1ufxuu7"> <p class="leafygreen-ui-1kp3ins"> However, if you restore from files taken via "cold" backup (i.e. the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> is not running), MongoDB cannot detect "dirty" keys on startup, and reuse of IV voids confidentiality and integrity guarantees. </p> <p class="leafygreen-ui-1kp3ins"> Starting in 4.2, to avoid the reuse of the keys after restoring from a cold filesystem snapshot, MongoDB adds a new command-line option <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--eseDatabaseKeyRollover"> <code class="leafygreen-ui-1l06pbn"> --eseDatabaseKeyRollover </code> </a> . When started with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--eseDatabaseKeyRollover"> <code class="leafygreen-ui-1l06pbn"> --eseDatabaseKeyRollover </code> </a> option, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance rolls over the database keys configured with <code class="leafygreen-ui-1l06pbn"> AES256-GCM </code> cipher and exits. </p> </dd> </dl> </li> </ul> </dd> </dl> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Drop the <code class="leafygreen-ui-1l06pbn"> local </code> database if it exists in the backup. <a class="headerlink leafygreen-ui-1kepx47" href="#drop-the-local-database-if-it-exists-in-the-backup" 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="drop-the-local-database-if-it-exists-in-the-backup"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you are restoring from a filesystem backup (or any backup with the <code class="leafygreen-ui-1l06pbn"> local </code> database), drop the <code class="leafygreen-ui-1l06pbn"> local </code> database. </p> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Start a standalone <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> using the data files from the backup as the data path. <a class="headerlink leafygreen-ui-1kepx47" href="#start-a-standalone-using-the-data-files-from-the-backup-as-the-data-path" 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="start-a-standalone-using-the-data-files-from-the-backup-as-the-data-path"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> You must also specify the same <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-label-mongod-options"> startup options </a> that were used when the snapshot was created. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --dbpath /data/db &lt;startup&gt;\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --dbpath /data/db &lt;startup options&gt;</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> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Drop the <code class="leafygreen-ui-1l06pbn"> local </code> database. <a class="headerlink leafygreen-ui-1kepx47" href="#drop-the-local-database" 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="drop-the-local-database"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Connect <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> to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance and drop the <code class="leafygreen-ui-1l06pbn"> local </code> database. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use local\ndb.dropDatabase()\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use local</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">dropDatabase</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"> Shut down the standalone. </p> </section> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Start a new single-node replica set. <a class="headerlink leafygreen-ui-1kepx47" href="#start-a-new-single-node-replica-set" 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="start-a-new-single-node-replica-set"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Start a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance as a new single-node replica set. Specify the path to the backup data files with <code class="leafygreen-ui-1l06pbn"> --dbpath </code> option and the replica set name with the <code class="leafygreen-ui-1l06pbn"> --replSet </code> option. For <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-config-servers/#std-label-csrs"> config server replica set (CSRS) </a> , include the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--configsvr"> <code class="leafygreen-ui-1l06pbn"> --configsvr </code> </a> option. Include any other options as appropriate for your deployment. </p> <p class="leafygreen-ui-1kp3ins"> You must also specify the same <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-label-mongod-options"> startup options </a> that were used when the snapshot was created. </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"> If your replica set members are run on different hosts or if you wish remote clients to connect to your instance, you must specify the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> setting (or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--bind_ip"> <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> </a> ). </p> </div> </div> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Before you bind your instance to a publicly-accessible IP address, you must secure your cluster from unauthorized access. For a complete list of security recommendations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-security-checklist"> Security Checklist for Self-Managed Deployments </a> . At minimum, consider <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-checklist-auth"> enabling authentication </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-hardening/#std-label-network-config-hardening"> hardening network infrastructure <!-- --> . </a> </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --dbpath /data/db --replSet &lt;replname&gt; &lt;startup&gt;\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --dbpath /data/db --replSet &lt;replName&gt; &lt;startup options&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> All MongoDB collections have <span class="leafygreen-ui-vm4wms" tabindex="0"> UUIDs </span> by default. When MongoDB restores collections, the restored collections retain their original UUIDs. When restoring a collection where no UUID was present, MongoDB generates a UUID for the restored collection. </p> <p class="leafygreen-ui-1kp3ins"> For more information on collection UUIDs, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/databases-and-collections/#std-label-collections"> Collections <!-- --> . </a> </p> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Connect <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> to the <code class="leafygreen-ui-1l06pbn"> mongod </code> instance. <a class="headerlink leafygreen-ui-1kepx47" href="#connect-to-the-mongod-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="connect-to-the-mongod-instance"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> From the same machine where one of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> is running (in this tutorial, <code class="leafygreen-ui-1l06pbn"> mongodb0.example.net </code> ), start <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> . To connect to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> listening to localhost on the default port of <code class="leafygreen-ui-1l06pbn"> 27017 </code> , simply issue: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh</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"> Depending on your path, you may need to specify the path to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> binary. </p> <p class="leafygreen-ui-1kp3ins"> If your <code class="leafygreen-ui-1l06pbn"> mongod </code> is not running on the default port, specify the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-option-mongosh.--port" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --port </code> </span> </a> option for <code class="leafygreen-ui-1l06pbn"> mongosh </code> . </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Initiate the new replica set. <a class="headerlink leafygreen-ui-1kepx47" href="#initiate-the-new-replica-set" 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="initiate-the-new-replica-set"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.initiate/#mongodb-method-rs.initiate"> <code class="leafygreen-ui-1l06pbn"> rs.initiate() </code> </a> on <em> one and only one </em> member of the replica set: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"rs.initiate( {\n _id : &lt;replname&gt;,\n members: [ { _id : 0, host : &lt;host:port&gt; } ]\n})\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">initiate</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->_id <!-- -->: &lt;<!-- -->replName<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">members</span>: <!-- -->[ <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">0</span>, <!-- -->host <!-- -->: &lt;<span class="lg-highlight-attr">host</span>:<!-- -->port<!-- -->&gt; <!-- -->} ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB initiates a set that consists of the current member and that uses the default replica set configuration. </p> </section> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-restore-add-members"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Add Members to the Replica Set <a class="headerlink leafygreen-ui-1kepx47" href="#add-members-to-the-replica-set" 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="add-members-to-the-replica-set"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> MongoDB provides two options for restoring secondary members of a replica set: </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="#std-label-restore-rs-copy-db-files" target="_self"> <span> Manually copy the database files </span> </a> to each data directory. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-restore-rs-initial-sync" target="_self"> <span> Allow initial sync </span> </a> to distribute data automatically. </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If your database is large, initial sync can take a long time to complete. For large databases, it might be preferable to copy the database files onto each host. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-restore-rs-copy-db-files"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Copy Database Files and Restart <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> Instance <a class="headerlink leafygreen-ui-1kepx47" href="#copy-database-files-and-restart--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="copy-database-files-and-restart--instance"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use the following sequence of operations to "seed" additional members of the replica set with the restored data by copying MongoDB data files directly. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Shut down the mongod instance that you restored.Use --shutdown or\ndb.shutdownServer() to ensure a clean shut down."},{"@type":"HowToStep","text":"Copy the primary's data directory to each secondary.Copy the primary's data directory into the\ndbPath of the other members of the replica set."},{"@type":"HowToStep","text":"Start the mongod instance that you restored."},{"@type":"HowToStep","text":"Add the secondaries to the replica set.In a mongosh session that is connected to the\nprimary, add the secondaries to the\nreplica set using the rs.add() method. See\nDeploy a Self-Managed Replica Set for more information about\ndeploying a replica set."}],"name":"Copy Database Files and Restart mongod Instance","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Shut down the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance that you restored. <a class="headerlink leafygreen-ui-1kepx47" href="#shut-down-the-instance-that-you-restored" 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="shut-down-the-instance-that-you-restored"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--shutdown"> <code class="leafygreen-ui-1l06pbn"> --shutdown </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.shutdownServer/#mongodb-method-db.shutdownServer"> <code class="leafygreen-ui-1l06pbn"> db.shutdownServer() </code> </a> to ensure a clean shut down. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Copy the primary's data directory to each secondary. <a class="headerlink leafygreen-ui-1kepx47" href="#copy-the-primary-s-data-directory-to-each-secondary" 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="copy-the-primary-s-data-directory-to-each-secondary"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Copy the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary's </a> data directory into the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> dbPath </code> </a> of the other members of the replica set. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Start the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance that you restored. <a class="headerlink leafygreen-ui-1kepx47" href="#start-the-instance-that-you-restored" 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="start-the-instance-that-you-restored"> </div> </a> </h4> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Add the secondaries to the replica set. <a class="headerlink leafygreen-ui-1kepx47" href="#add-the-secondaries-to-the-replica-set" 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="add-the-secondaries-to-the-replica-set"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> In 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> session that is connected to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> , add the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondaries </a> to the replica set using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.add/#mongodb-method-rs.add"> <code class="leafygreen-ui-1l06pbn"> rs.add() </code> </a> method. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/deploy-replica-set/"> Deploy a Self-Managed Replica Set </a> for more information about deploying a replica set. </p> </section> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-restore-rs-initial-sync"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Update Secondaries using Initial Sync <a class="headerlink leafygreen-ui-1kepx47" href="#update-secondaries-using-initial-sync" 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="update-secondaries-using-initial-sync"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use the following sequence of operations to "seed" additional members of the replica set with the restored data using the default <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-sync/#std-label-replica-set-initial-sync"> initial sync </a> operation. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Empty the data directory for each prospective replica set member.For example, if the replica set member has a\nstorage.dbPath or --dbpath\nof /data/db, you must ensure that directory exists and\nis empty."},{"@type":"HowToStep","text":"Start each replica set member."},{"@type":"HowToStep","text":"Add each prospective member to the replica set.Connect to the primary using the mongo\nshell and add each secondary to the replica set using\nrs.add().When you add a member to the replica set, Initial Sync copies the data from the primary to\nthe new member."}],"name":"Update Secondaries using Initial Sync","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Empty the data directory for each prospective replica set member. <a class="headerlink leafygreen-ui-1kepx47" href="#empty-the-data-directory-for-each-prospective-replica-set-member" 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="empty-the-data-directory-for-each-prospective-replica-set-member"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> For example, if the replica set member has a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> storage.dbPath </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--dbpath"> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> </a> of <code class="leafygreen-ui-1l06pbn"> /data/db </code> , you <strong> must </strong> ensure that directory exists <em> and </em> is empty. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Start each replica set member. <a class="headerlink leafygreen-ui-1kepx47" href="#start-each-replica-set-member" 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="start-each-replica-set-member"> </div> </a> </h4> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Add each prospective member to the replica set. <a class="headerlink leafygreen-ui-1kepx47" href="#add-each-prospective-member-to-the-replica-set" 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="add-each-prospective-member-to-the-replica-set"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Connect to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo"> <code class="leafygreen-ui-1l06pbn"> mongo </code> </a> shell and add each secondary to the replica set using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.add/#mongodb-method-rs.add"> <code class="leafygreen-ui-1l06pbn"> rs.add() </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> When you add a member to the replica set, <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-sync/#std-label-replica-set-initial-sync"> Initial Sync </a> copies the data from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> to the new member. </p> </section> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/db.createUser/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.createUser() <a class="headerlink leafygreen-ui-1kepx47" href="#db.createuser--" 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.createuser--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#required-access" target="_self"> <span> Required Access </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.createUser(user, writeConcern) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.createUser" 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-method-db.createUser"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Creates a new user for the database on which the method is run. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </span> </a> returns a <em> duplicate user </em> error if the user already exists on the database. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> mongosh Method </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page documents 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> method. This is <em> not </em> the documentation for database commands or language-specific drivers, such as Node.js. </p> <p class="leafygreen-ui-1kp3ins"> For the database command, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createUser/#mongodb-dbcommand-dbcmd.createUser"> <code class="leafygreen-ui-1l06pbn"> createUser </code> </a> command <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB API drivers, refer to the language-specific <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB driver documentation <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </span> </a> method has the following syntax: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> user </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The document with authentication and access information about the user to create. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> writeConcern </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The level of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern"> write concern </a> for the operation. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-specs"> Write Concern Specification <!-- --> . </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> user </code> document defines the user and has the following form: </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n user: \"&lt;name&gt;\",\n pwd: passwordPrompt(), // Or \"&lt;cleartext&gt;\"\n customData: { &lt;any&gt; },\n roles: [\n { role: \"&lt;role&gt;\", db: \"&lt;database&gt;\" } | \"&lt;role&gt;\",\n ...\n ],\n authenticationRestrictions: [\n {\n clientSource: [\"&lt;ip&gt;\" | \"&lt;cidr&gt;\", ...],\n serverAddress: [\"&lt;ip&gt;\" | \"&lt;cidr&gt;\", ...]\n },\n ...\n ],\n mechanisms: [ \"&lt;scram-sha-1|scram-sha-256&gt;\", ... ],\n passwordDigestor: \"&lt;server|client&gt;\"\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">user</span>: <span class="lg-highlight-string">"&lt;name&gt;"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pwd</span>: <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)<!-- -->, <span class="lg-highlight-comment">// Or "&lt;cleartext password&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">customData</span>: <!-- -->{ <!-- -->&lt;any information&gt; },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> roles: [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { role: "&lt;role&gt;", db: "&lt;database&gt;" } | "&lt;role&gt;",</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> authenticationRestrictions: [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> clientSource: ["&lt;IP&gt;" | "&lt;CIDR range&gt;", ...],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> serverAddress: ["&lt;IP&gt;" | "&lt;CIDR range&gt;", ...]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> mechanisms: [ "&lt;SCRAM-SHA-1|SCRAM-SHA-256&gt;", ... ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> passwordDigestor: "&lt;server|client&gt;"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> user </code> document has the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> user </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The name of the new user. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> pwd </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> The user's password. The <code class="leafygreen-ui-1l06pbn"> pwd </code> field is not required if you run <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </span> </a> on the <code class="leafygreen-ui-1l06pbn"> $external </code> database to create users who have credentials stored externally to MongoDB. </p> <p class="leafygreen-ui-1kp3ins"> The value can be either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the user's password in cleartext string, or </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> to prompt for the user's password. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> customData </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. Any arbitrary information. This field can be used to store any data an admin wishes to associate with this particular user. For example, this could be the user's full name or employee id. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> roles </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> array </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The roles granted to the user. Can specify an empty array <code class="leafygreen-ui-1l06pbn"> [] </code> to create users without roles. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-db-createUser-authenticationRestrictions" target="_self"> <span> authenticationRestrictions </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> array </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-db-createUser-authenticationRestrictions"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. The authentication restrictions the server enforces on the created user. Specifies a list of IP addresses and <span class="leafygreen-ui-vm4wms" tabindex="0"> CIDR </span> ranges from which the user is allowed to connect to the server or from which the server can accept users. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mechanisms </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> array </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Specify the specific SCRAM mechanism or mechanisms for creating SCRAM user credentials. If <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.authenticationMechanisms"> <code class="leafygreen-ui-1l06pbn"> authenticationMechanisms </code> </a> is specified, you can only specify a subset of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.authenticationMechanisms"> <code class="leafygreen-ui-1l06pbn"> authenticationMechanisms </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Valid values are: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "SCRAM-SHA-1" </code> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses the <code class="leafygreen-ui-1l06pbn"> SHA-1 </code> hashing function. </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "SCRAM-SHA-256" </code> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses the <code class="leafygreen-ui-1l06pbn"> SHA-256 </code> hashing function. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Requires passwordDigestor to be <code class="leafygreen-ui-1l06pbn"> server </code> . </p> </li> </ul> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The default is both <code class="leafygreen-ui-1l06pbn"> SCRAM-SHA-1 </code> and <code class="leafygreen-ui-1l06pbn"> SCRAM-SHA-256 </code> . </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> passwordDigestor </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Indicates whether the server or the client digests the password. </p> <p class="leafygreen-ui-1kp3ins"> Available values are: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <dl> <dt> <code class="leafygreen-ui-1l06pbn"> "server" </code> (Default) </dt> <dd class="css-1ufxuu7"> The server receives undigested password from the client and digests the password. </dd> </dl> </li> <li class="leafygreen-ui-d7p7b6"> <dl> <dt> <code class="leafygreen-ui-1l06pbn"> "client" </code> (Not compatible with <code class="leafygreen-ui-1l06pbn"> SCRAM-SHA-256 </code> ) </dt> <dd class="css-1ufxuu7"> The client digests the password and passes the digested password to the server. </dd> </dl> </li> </ul> </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This method is available in deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <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 command is not supported in M0, M2, M5, and M10+ clusters. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Roles <a class="headerlink leafygreen-ui-1kepx47" href="#roles" 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="roles"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> In the <code class="leafygreen-ui-1l06pbn"> roles </code> field, you can specify both <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-built-in-roles"> built-in roles </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-user-defined-roles/#std-label-user-defined-roles"> user-defined roles <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To specify a role that exists in the same database where <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </span> </a> runs, you can either specify the role with the name of the role: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"readWrite\"","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string">"readWrite"</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"> Or you can specify the role with a document, as in: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ role: \"&lt;role&gt;\", db: \"&lt;database&gt;\" }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"&lt;role&gt;"</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"&lt;database&gt;"</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To specify a role that exists in a different database, specify the role with a document. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-method-createUser-authentication-restrictions"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Authentication Restrictions <a class="headerlink leafygreen-ui-1kepx47" href="#authentication-restrictions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="authentication-restrictions"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> authenticationRestrictions </code> document can contain <em> only </em> the following fields. The server throws an error if the <code class="leafygreen-ui-1l06pbn"> authenticationRestrictions </code> document contains an unrecognized field: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:30%"/> <col style="width:50%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> clientSource </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Array of IP addresses and/or <span class="leafygreen-ui-vm4wms" tabindex="0"> CIDR </span> ranges </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> If present, when authenticating a user, the server verifies that the client's IP address is either in the given list or belongs to a CIDR range in the list. If the client's IP address is not present, the server does not authenticate the user. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> serverAddress </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Array of IP addresses and/or <span class="leafygreen-ui-vm4wms" tabindex="0"> CIDR </span> ranges </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> A list of IP addresses or CIDR ranges to which the client can connect. If present, the server will verify that the client's connection was accepted via an IP address in the given list. If the connection was accepted via an unrecognized IP address, the server does not authenticate the user. </div> </div> </td> </tr> </tbody> </table> </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"> If a user inherits multiple roles with incompatible authentication restrictions, that user becomes unusable. </p> <p class="leafygreen-ui-1kp3ins"> For example, if a user inherits one role in which the <code class="leafygreen-ui-1l06pbn"> clientSource </code> field is <code class="leafygreen-ui-1l06pbn"> ["198.51.100.0"] </code> and another role in which the <code class="leafygreen-ui-1l06pbn"> clientSource </code> field is <code class="leafygreen-ui-1l06pbn"> ["203.0.113.0"] </code> the server is unable to authenticate the user. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on authentication in MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-authentication"> Authentication on Self-Managed Deployments <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </span> </a> method wraps the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createUser/#mongodb-dbcommand-dbcmd.createUser"> <code class="leafygreen-ui-1l06pbn"> createUser </code> </a> command. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> User ID <a class="headerlink leafygreen-ui-1kepx47" href="#user-id" 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="user-id"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB automatically assigns a unique <code class="leafygreen-ui-1l06pbn"> userId </code> to the user upon creation. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Replica set <a class="headerlink leafygreen-ui-1kepx47" href="#replica-set" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="replica-set"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If run on a replica set, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </span> </a> is executed using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> write concern by default. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Encryption <a class="headerlink leafygreen-ui-1kepx47" href="#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="encryption"> </div> </a> </h3> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> By default, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </span> </a> sends all specified data to the MongoDB instance in cleartext, even if using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> . Use TLS transport encryption to protect communications between clients and the server, including the password sent by <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </span> </a> . For instructions on enabling TLS transport encryption, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> MongoDB does not store the password in cleartext. The password is only vulnerable in transit between the client and the server, and only if TLS transport encryption is not enabled. </p> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> External Credentials <a class="headerlink leafygreen-ui-1kepx47" href="#external-credentials" 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="external-credentials"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Users created on the <code class="leafygreen-ui-1l06pbn"> $external </code> database should have credentials stored externally to MongoDB, as, for example, with <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/control-access-to-mongodb-with-kerberos-authentication/"> MongoDB Enterprise installations that use Kerberos <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To use <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-isolation-consistency-recency/#std-label-sessions"> Client Sessions and Causal Consistency Guarantees </a> with <code class="leafygreen-ui-1l06pbn"> $external </code> authentication users (Kerberos, LDAP, or x.509 users), usernames cannot be greater than 10k bytes. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> local </code> Database <a class="headerlink leafygreen-ui-1kepx47" href="#local-database" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="local-database"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You cannot create users on the local database. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Required Access <a class="headerlink leafygreen-ui-1kepx47" href="#required-access" 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="required-access"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To create a new user in a database, you must have the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-createUser"> <code class="leafygreen-ui-1l06pbn"> createUser </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#std-label-security-user-actions"> action </a> on that <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/resource-document/#std-label-resource-specific-db"> database resource <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To grant roles to a user, you must have the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-grantRole"> <code class="leafygreen-ui-1l06pbn"> grantRole </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#std-label-security-user-actions"> action </a> on the role's database. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-userAdmin"> <code class="leafygreen-ui-1l06pbn"> userAdmin </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-userAdminAnyDatabase"> <code class="leafygreen-ui-1l06pbn"> userAdminAnyDatabase </code> </a> built-in roles provide <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-createUser"> <code class="leafygreen-ui-1l06pbn"> createUser </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-grantRole"> <code class="leafygreen-ui-1l06pbn"> grantRole </code> </a> actions on their respective <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/resource-document/#std-label-resource-document"> resources <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.createUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </span> </a> operation creates the <code class="leafygreen-ui-1l06pbn"> accountAdmin01 </code> user on the <code class="leafygreen-ui-1l06pbn"> products </code> database. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use products\ndb.createUser( { user: \"accountAdmin01\",\n pwd: passwordPrompt(), // Or \"&lt;cleartext&gt;\"\n customData: { employeeId: 12345 },\n roles: [ { role: \"clusterAdmin\", db: \"admin\" },\n { role: \"readAnyDatabase\", db: \"admin\" },\n \"readWrite\"] },\n { w: \"majority\" , wtimeout: 5000 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use products</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createUser</span>( <!-- -->{ <span class="lg-highlight-attr">user</span>: <span class="lg-highlight-string">"accountAdmin01"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pwd</span>: <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)<!-- -->, <span class="lg-highlight-comment">// Or "&lt;cleartext password&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">customData</span>: <!-- -->{ <span class="lg-highlight-attr">employeeId</span>: <span class="lg-highlight-number">12345</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"clusterAdmin"</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"admin"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"readAnyDatabase"</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"admin"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"readWrite"</span>] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-string">"majority"</span> <!-- -->, <span class="lg-highlight-attr">wtimeout</span>: <span class="lg-highlight-number">5000</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 operation gives <code class="leafygreen-ui-1l06pbn"> accountAdmin01 </code> the following roles: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the <code class="leafygreen-ui-1l06pbn"> clusterAdmin </code> and <code class="leafygreen-ui-1l06pbn"> readAnyDatabase </code> roles on the <code class="leafygreen-ui-1l06pbn"> admin </code> database </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the <code class="leafygreen-ui-1l06pbn"> readWrite </code> role on the <code class="leafygreen-ui-1l06pbn"> products </code> database </p> </li> </ul> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create User with Roles <a class="headerlink leafygreen-ui-1kepx47" href="#create-user-with-roles" 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-user-with-roles"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following operation creates <code class="leafygreen-ui-1l06pbn"> accountUser </code> in the <code class="leafygreen-ui-1l06pbn"> products </code> database and gives the user the <code class="leafygreen-ui-1l06pbn"> readWrite </code> and <code class="leafygreen-ui-1l06pbn"> dbAdmin </code> roles. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use products\ndb.createUser(\n {\n user: \"accountUser\",\n pwd: passwordPrompt(), // Or \"&lt;cleartext&gt;\"\n roles: [ \"readWrite\", \"dbAdmin\" ]\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use products</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createUser</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">user</span>: <span class="lg-highlight-string">"accountUser"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pwd</span>: <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)<!-- -->, <span class="lg-highlight-comment">// Or "&lt;cleartext password&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>: <!-- -->[ <span class="lg-highlight-string">"readWrite"</span>, <span class="lg-highlight-string">"dbAdmin"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create User without Roles <a class="headerlink leafygreen-ui-1kepx47" href="#create-user-without-roles" 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-user-without-roles"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following operation creates a user named <code class="leafygreen-ui-1l06pbn"> reportsUser </code> in the <code class="leafygreen-ui-1l06pbn"> admin </code> database but does not yet assign roles: </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use admin\ndb.createUser(\n {\n user: \"reportsUser\",\n pwd: passwordPrompt(), // Or \"&lt;cleartext&gt;\"\n roles: [ ]\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use admin</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createUser</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">user</span>: <span class="lg-highlight-string">"reportsUser"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pwd</span>: <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)<!-- -->, <span class="lg-highlight-comment">// Or "&lt;cleartext password&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>: <!-- -->[ <!-- -->]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create Administrative User with Roles <a class="headerlink leafygreen-ui-1kepx47" href="#create-administrative-user-with-roles" 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-administrative-user-with-roles"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following operation creates a user named <code class="leafygreen-ui-1l06pbn"> appAdmin </code> in the <code class="leafygreen-ui-1l06pbn"> admin </code> database and gives the user <code class="leafygreen-ui-1l06pbn"> readWrite </code> access to the <code class="leafygreen-ui-1l06pbn"> config </code> database, which lets the user change certain settings for sharded clusters, such as to the balancer setting. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use admin\ndb.createUser(\n {\n user: \"appAdmin\",\n pwd: passwordPrompt(), // Or \"&lt;cleartext&gt;\"\n roles:\n [\n { role: \"readWrite\", db: \"config\" },\n \"clusterAdmin\"\n ]\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use admin</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createUser</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">user</span>: <span class="lg-highlight-string">"appAdmin"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pwd</span>: <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)<!-- -->, <span class="lg-highlight-comment">// Or "&lt;cleartext password&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"readWrite"</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"config"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"clusterAdmin"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create User with Authentication Restrictions <a class="headerlink leafygreen-ui-1kepx47" href="#create-user-with-authentication-restrictions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-user-with-authentication-restrictions"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following operation creates a user named <code class="leafygreen-ui-1l06pbn"> restricted </code> in the <code class="leafygreen-ui-1l06pbn"> admin </code> database. This user may only authenticate if connecting from IP address <code class="leafygreen-ui-1l06pbn"> 192.0.2.0 </code> to IP address <code class="leafygreen-ui-1l06pbn"> 198.51.100.0 </code> . </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use admin\ndb.createUser(\n {\n user: \"restricted\",\n pwd: passwordPrompt(), // Or \"&lt;cleartext&gt;\"\n roles: [ { role: \"readWrite\", db: \"reporting\" } ],\n authenticationRestrictions: [ {\n clientSource: [\"192.0.2.0\"],\n serverAddress: [\"198.51.100.0\"]\n } ]\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use admin</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createUser</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">user</span>: <span class="lg-highlight-string">"restricted"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pwd</span>: <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)<!-- -->, <span class="lg-highlight-comment">// Or "&lt;cleartext password&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"readWrite"</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"reporting"</span> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">authenticationRestrictions</span>: <!-- -->[ <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">clientSource</span>: <!-- -->[<span class="lg-highlight-string">"192.0.2.0"</span>]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">serverAddress</span>: <!-- -->[<span class="lg-highlight-string">"198.51.100.0"</span>]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create User with <code class="leafygreen-ui-1l06pbn"> SCRAM-SHA-256 </code> Credentials Only <a class="headerlink leafygreen-ui-1kepx47" href="#create-user-with-scram-sha-256-credentials-only" 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-user-with-scram-sha-256-credentials-only"> </div> </a> </h3> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To use <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-scram/#std-label-authentication-scram-sha-256"> SCRAM-SHA-256 </a> , the <code class="leafygreen-ui-1l06pbn"> featureCompatibilityVersion </code> must be set to <code class="leafygreen-ui-1l06pbn"> 4.0 </code> . For more information on featureCompatibilityVersion, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-view-fcv"> Get FeatureCompatibilityVersion </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#mongodb-dbcommand-dbcmd.setFeatureCompatibilityVersion"> <code class="leafygreen-ui-1l06pbn"> setFeatureCompatibilityVersion </code> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation creates a user with only <code class="leafygreen-ui-1l06pbn"> SCRAM-SHA-256 </code> credentials. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use reporting\ndb.createUser(\n {\n user: \"reportUser256\",\n pwd: passwordPrompt(), // Or \"&lt;cleartext&gt;\"\n roles: [ { role: \"readWrite\", db: \"reporting\" } ],\n mechanisms: [ \"SCRAM-SHA-256\" ]\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use reporting</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createUser</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">user</span>: <span class="lg-highlight-string">"reportUser256"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pwd</span>: <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)<!-- -->, <span class="lg-highlight-comment">// Or "&lt;cleartext password&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"readWrite"</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"reporting"</span> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">mechanisms</span>: <!-- -->[ <span class="lg-highlight-string">"SCRAM-SHA-256"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.authenticationMechanisms"> <code class="leafygreen-ui-1l06pbn"> authenticationMechanisms </code> </a> parameter is set, the <code class="leafygreen-ui-1l06pbn"> mechanisms </code> field can only include values specified in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.authenticationMechanisms"> <code class="leafygreen-ui-1l06pbn"> authenticationMechanisms </code> </a> parameter. </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/ObjectId/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> ObjectId() <a class="headerlink leafygreen-ui-1kepx47" href="#objectid--" 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="objectid--"> </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="#description" target="_self"> <span> Description </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#methods" target="_self"> <span> Methods </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-core-object-id-class"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Description <a class="headerlink leafygreen-ui-1kepx47" href="#description" 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="description"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> ObjectId(&lt;value&gt;) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-ObjectId" 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-method-ObjectId"> </div> </a> </dt> <dd> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> mongosh Method </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page documents 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> method. This is <em> not </em> the documentation for a language-specific driver, such as Node.js. </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB API drivers, refer to the language-specific <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB driver documentation <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Returns a new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-objectid"> ObjectId </a> . The 12-byte <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-objectid"> ObjectId </a> consists of: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A 4-byte timestamp, representing the ObjectId's creation, measured in seconds since the Unix epoch. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A 5-byte random value generated once per process. This random value is unique to the machine and process. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A 3-byte incrementing counter, initialized to a random value. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For timestamp and counter values, the most significant bytes appear first in the byte sequence (big-endian). This is unlike other BSON values, where the least significant bytes appear first (little-endian). </p> <p class="leafygreen-ui-1kp3ins"> If an integer value is used to create an ObjectId, the integer replaces the timestamp. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can use <code class="leafygreen-ui-1l06pbn"> ObjectId() </code> for deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-ObjectId" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> ObjectId() </code> </span> </a> can accept one of the following inputs: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Input Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> hexadecimal </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. A 24 character hexadecimal string value for the new ObjectId. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> integer </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. The integer value, in seconds, is added to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/Unix epoch" rel="noopener noreferrer"> <span> Unix epoch </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> to create the new timestamp. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Methods <a class="headerlink leafygreen-ui-1kepx47" href="#methods" 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="methods"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-ObjectId" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> ObjectId() </code> </span> </a> has the following methods: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Methods </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/ObjectId.getTimestamp/#mongodb-method-ObjectId.getTimestamp"> <code class="leafygreen-ui-1l06pbn"> ObjectId.getTimestamp() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the timestamp portion of the object as a Date. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/ObjectId.toString/#mongodb-method-ObjectId.toString"> <code class="leafygreen-ui-1l06pbn"> ObjectId.toString() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the ObjectId as a hexadecimal string. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <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> replaces the legacy <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. The <code class="leafygreen-ui-1l06pbn"> ObjectId() </code> methods work differently in <code class="leafygreen-ui-1l06pbn"> mongosh </code> than in the legacy <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. For more information on the legacy methods, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#std-label-mongo"> Legacy mongo Shell <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Generate a New ObjectId <a class="headerlink leafygreen-ui-1kepx47" href="#generate-a-new-objectid" 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="generate-a-new-objectid"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To generate a new ObjectId, use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-ObjectId" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> ObjectId() </code> </span> </a> with no argument: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"newObjectId = ObjectId()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">newObjectId <!-- -->= <span class="lg-highlight-title lg-highlight-class">ObjectId</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"> In this example, the value of <code class="leafygreen-ui-1l06pbn"> newObjectId </code> is: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"ObjectId(\"507f1f77bcf86cd799439011\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"507f1f77bcf86cd799439011"</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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Return a Hexadecimal String <a class="headerlink leafygreen-ui-1kepx47" href="#return-a-hexadecimal-string" 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="return-a-hexadecimal-string"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To return the ObjectId as a hexadecimal string, use the <code class="leafygreen-ui-1l06pbn"> toString() </code> method. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"ObjectId(\"507f191e810c19729de860ea\").toString()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"507f191e810c19729de860ea"</span>).<span class="lg-highlight-title lg-highlight-function">toString</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 method returns: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"507f191e810c19729de860ea"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">507f191e810c19729de860ea</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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify a Date <a class="headerlink leafygreen-ui-1kepx47" href="#specify-a-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="specify-a-date"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can use a custom <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-date"> Date </a> to specify an ObjectId. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Internally, Date objects are stored as signed\n64-bit integer that represents the number of milliseconds since the\nUnix epoch. To learn more, see Date().","name":"Set a variable for your specified date"},{"@type":"HowToStep","text":"Convert your Date object to seconds"},{"@type":"HowToStep","text":"You can verify the Date by using ObjectId.getTimestamp().","name":"Set your new ObjectId with timestamp as the argument"}],"name":"Specify a Date","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Set a variable for your specified date <a class="headerlink leafygreen-ui-1kepx47" href="#set-a-variable-for-your-specified-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="set-a-variable-for-your-specified-date"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Internally, Date objects are stored as signed 64-bit integer that represents the number of milliseconds since the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/Unix epoch" rel="noopener noreferrer"> <span> Unix epoch </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> . To learn more, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Date/#mongodb-method-Date"> <code class="leafygreen-ui-1l06pbn"> Date() </code> . </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"myDate = new Date( \"2024-01-01\" )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">myDate <!-- -->= <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>( <span class="lg-highlight-string">"2024-01-01"</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Convert your Date object to seconds <a class="headerlink leafygreen-ui-1kepx47" href="#convert-your-date-object-to-seconds" 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="convert-your-date-object-to-seconds"> </div> </a> </h4> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"timestamp = Math.floor( myDate / 1000 )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">timestamp <!-- -->= <span class="lg-highlight-title lg-highlight-class">Math</span>.<span class="lg-highlight-title lg-highlight-function">floor</span>( <!-- -->myDate <!-- -->/ <span class="lg-highlight-number">1000</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Set your new ObjectId with <code class="leafygreen-ui-1l06pbn"> timestamp </code> as the argument <a class="headerlink leafygreen-ui-1kepx47" href="#set-your-new-objectid-with-timestamp-as-the-argument" 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="set-your-new-objectid-with-timestamp-as-the-argument"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> You can verify the Date by using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/ObjectId.getTimestamp/#mongodb-method-ObjectId.getTimestamp"> <code class="leafygreen-ui-1l06pbn"> ObjectId.getTimestamp() </code> . </a> </p> <div class="css-1f5771r"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"newObjectId = ObjectId(timestamp)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">newObjectId <!-- -->= <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<!-- -->timestamp)</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="css-9st569 efa38qy0" style="--border-color:#E8EDEB"> <button aria-disabled="false" class="lg-ui-button-0000 leafygreen-ui-hix6y6" data-lgid="lg-button" role="button" type="button"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg alt="" aria-hidden="true" class="leafygreen-ui-hjnzs9" fill="none" height="16" role="presentation" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M14.364 10.778a1 1 0 0 0 0-1.414l-4.95-4.95-.707-.707a1 1 0 0 0-1.414 0l-.707.707-4.95 4.95a1 1 0 0 0 0 1.414l.707.707a1 1 0 0 0 1.414 0L8 7.243l4.243 4.242a1 1 0 0 0 1.414 0l.707-.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> HIDE OUTPUT </div> </button> </div> <div class="leafygreen-ui-1oteowz"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"ObjectId(\"6592008029c8c3e4dc76256c\")","programmingLanguage":"JavaScript"} </script> <div class="css-1sax7hu e11q6jfk0" style="--code-container-border:initial;--code-pre-border:none"> <div class="leafygreen-ui-1fyvhqe"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1qhgg7e" tabindex="-1"><code class="lg-highlight-hljs-dark javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"6592008029c8c3e4dc76256c"</span>)</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </section> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify an Integer String <a class="headerlink leafygreen-ui-1kepx47" href="#specify-an-integer-string" 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="specify-an-integer-string"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you want to adjust the ObjectId timestamp, use an integer to generate a new ObjectId. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"newObjectId = ObjectId(32)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">newObjectId <!-- -->= <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-number">32</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 ObjectId value resembles: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"ObjectId(\"00000020f51bb4362eee2a4d\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"00000020f51bb4362eee2a4d"</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 example ObjectId consists of: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A four byte time stamp, <code class="leafygreen-ui-1l06pbn"> 00000020 </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A five byte random element, <code class="leafygreen-ui-1l06pbn"> f51bb4362e </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A three byte counter, <code class="leafygreen-ui-1l06pbn"> ee2a4d </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The first four bytes of the ObjectId are the number of seconds since the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/Unix epoch" rel="noopener noreferrer"> <span> Unix epoch </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> . In this example, the ObjectId timestamp is <code class="leafygreen-ui-1l06pbn"> 00000020 </code> which is <code class="leafygreen-ui-1l06pbn"> 32 </code> in hexadecimal. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify a Hexadecimal String <a class="headerlink leafygreen-ui-1kepx47" href="#specify-a-hexadecimal-string" 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="specify-a-hexadecimal-string"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you want to use a hexadecimal string to specify an ObjectId, pass a unique, 24 character hexadecimal value when you call <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-ObjectId" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> ObjectId() </code> : </span> </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"newObjectId = ObjectId(\"507f191e810c19729de860ea\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">newObjectId <!-- -->= <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"507f191e810c19729de860ea"</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-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/reference/bson-types/#std-label-objectid"> ObjectId BSON Type </a> </p> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/commitTransaction/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> commitTransaction <a class="headerlink leafygreen-ui-1kepx47" href="#committransaction" 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="committransaction"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> commitTransaction </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.commitTransaction" 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-dbcommand-dbcmd.commitTransaction"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Saves the changes made by the operations in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/"> multi-document transaction </a> and ends the transaction. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> In <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#std-program-mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , this command can also be run through the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Session.commitTransaction/#mongodb-method-Session.commitTransaction"> <code class="leafygreen-ui-1l06pbn"> Session.commitTransaction() </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Session.withTransaction/#mongodb-method-Session.withTransaction"> <code class="leafygreen-ui-1l06pbn"> Session.withTransaction() </code> </a> helper methods <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> Helper methods are convenient for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#std-program-mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> users, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> To run the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.commitTransaction" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> commitTransaction </code> </span> </a> , the command must be run against the <code class="leafygreen-ui-1l06pbn"> admin </code> database and run within a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Session/#mongodb-method-Session"> <code class="leafygreen-ui-1l06pbn"> Session() </code> . </a> </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand(\n {\n commitTransaction: 1,\n txnNumber: &lt;long&gt;,\n writeConcern: &lt;document&gt;,\n autocommit: false,\n comment: &lt;any&gt;\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">commitTransaction</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">txnNumber</span>: &lt;<!-- -->long<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">writeConcern</span>: &lt;<span class="lg-highlight-variable lg-highlight-language">document</span>&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">autocommit</span>: <span class="lg-highlight-literal">false</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">comment</span>: &lt;<!-- -->any<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Write Concern <a class="headerlink leafygreen-ui-1kepx47" href="#write-concern" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="write-concern"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When committing the transaction, the session uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/"> write concern </a> specified at the transaction start. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Session.startTransaction/#mongodb-method-Session.startTransaction"> <code class="leafygreen-ui-1l06pbn"> Session.startTransaction() </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If you commit using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-number-"> <code class="leafygreen-ui-1l06pbn"> "w: 1" </code> </a> write concern, your transaction can be <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-rollbacks/"> rolled back if there is a failover. <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Atomicity <a class="headerlink leafygreen-ui-1kepx47" href="#atomicity" 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="atomicity"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When a transaction commits, all data changes made in the transaction are saved and visible outside the transaction. That is, a transaction will not commit some of its changes while rolling back others. </p> <p class="leafygreen-ui-1kp3ins"> Until a transaction commits, the data changes made in the transaction are not visible outside the transaction. </p> <p class="leafygreen-ui-1kp3ins"> However, when a transaction writes to multiple shards, not all outside read operations need to wait for the result of the committed transaction to be visible across the shards. For example, if a transaction is committed and write 1 is visible on shard A but write 2 is not yet visible on shard B, an outside read at read concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-local/#mongodb-readconcern-readconcern.-local-"> <code class="leafygreen-ui-1l06pbn"> "local" </code> </a> can read the results of write 1 without seeing write 2. </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/db.auth/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.auth() <a class="headerlink leafygreen-ui-1kepx47" href="#db.auth--" 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.auth--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.auth" 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-method-db.auth"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Allows a user to authenticate to the database from within the shell. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> <p class="leafygreen-ui-1kp3ins"> If you use the <code class="leafygreen-ui-1l06pbn"> db.auth(&lt;username&gt;, &lt;password&gt;) </code> syntax and omit the password, the user is prompted to enter a password. </p> </div> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This method is available in deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <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 command is not supported in M0, M2, and M5 clusters. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.auth" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </span> </a> has the following syntax forms: </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-db-auth-syntax-username-password"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> db.auth(&lt;username&gt;, &lt;password&gt;) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#db.auth--username----password--" 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.auth--username----password--"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Omit the password to prompt the user to enter a password: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.auth( &lt;username&gt; )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">auth</span>( &lt;<!-- -->username<!-- -->&gt; <!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> to prompt the user to enter a password: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.auth( &lt;username&gt;, passwordPrompt() )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">auth</span>( &lt;<!-- -->username<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-title lg-highlight-function">passwordPrompt</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> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Specify a cleartext password. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.auth( &lt;username&gt;, &lt;password&gt; )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">auth</span>( &lt;<!-- -->username<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->password<!-- -->&gt; <!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-db-auth-syntax-user-document"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> db.auth(&lt;user document&gt;) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#db.auth--user-document--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="db.auth--user-document--"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.auth( {\n user: &lt;username&gt;,\n pwd: passwordPrompt(), // Or \"&lt;cleartext&gt;\"\n mechanism: &lt;authentication&gt;,\n digestPassword: &lt;boolean&gt;\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">auth</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">user</span>: &lt;<!-- -->username<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pwd</span>: <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)<!-- -->, <span class="lg-highlight-comment">// Or "&lt;cleartext password&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">mechanism</span>: <!-- -->&lt;authentication mechanism&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> digestPassword: &lt;boolean&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> user </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The name of the user with access privileges for this database. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> pwd </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> The user's password. The value can be either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the user's password in cleartext string, or </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> to prompt for the user's password. </p> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </li> </ul> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mechanism </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-option-mongosh.--authenticationMechanism" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> authentication mechanism </code> </span> </a> to use. </p> <p class="leafygreen-ui-1kp3ins"> For available mechanisms, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-option-mongosh.--authenticationMechanism" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> authentication mechanisms </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> If unspecified, uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hello/#mongodb-dbcommand-dbcmd.hello"> <code class="leafygreen-ui-1l06pbn"> hello </code> </a> command to determine the SASL mechanism or mechanisms for the specified user. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hello/#mongodb-data-hello.saslSupportedMechs"> <code class="leafygreen-ui-1l06pbn"> saslSupportedMechs </code> . </a> </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> digestPassword </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Determines whether or not the supplied password should be pre-hashed before being used with the specified authentication mechanism. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-scram/#std-label-scram-mechanisms"> SCRAM-SHA-1 </a> , although you may specify <code class="leafygreen-ui-1l06pbn"> true </code> , setting this value to <code class="leafygreen-ui-1l06pbn"> true </code> does not improve security and may interfere with credentials using other mechanisms. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For all other methods, this value must be set to <code class="leafygreen-ui-1l06pbn"> false </code> (default value). Any other value will result in authentication failure since those methods do not understand MongoDB pre-hashing. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The default value is <code class="leafygreen-ui-1l06pbn"> false </code> . </p> </div> </div> </td> </tr> </tbody> </table> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> excludes all <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.auth" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </span> </a> operations from the saved history. </p> </div> </div> <dl> <dt> Returns </dt> <dd class="css-1ufxuu7"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.auth" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </span> </a> returns <code class="leafygreen-ui-1l06pbn"> 0 </code> when authentication is <strong> not </strong> successful, and <code class="leafygreen-ui-1l06pbn"> 1 </code> when the operation is successful. </dd> </dl> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Client Disconnection <a class="headerlink leafygreen-ui-1kepx47" href="#client-disconnection" 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="client-disconnection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 4.2, if the client that issued <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.auth" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </span> </a> disconnects before the operation completes, MongoDB marks <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.auth" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </span> </a> for termination using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/killOp/#mongodb-dbcommand-dbcmd.killOp"> <code class="leafygreen-ui-1l06pbn"> killOp </code> . </a> </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> <p class="leafygreen-ui-1kp3ins"> If you use the <code class="leafygreen-ui-1l06pbn"> db.auth(&lt;username&gt;, &lt;password&gt;) </code> syntax and omit the password, the user is prompted to enter a password. </p> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Authenticate after Connecting to the Shell <a class="headerlink leafygreen-ui-1kepx47" href="#authenticate-after-connecting-to-the-shell" 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="authenticate-after-connecting-to-the-shell"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To authenticate after connecting <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> , issue <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.auth" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </span> </a> in the user's <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-users/#std-label-authentication-database"> authentication database <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use test\ndb.auth( \"myTestDBUser\", passwordPrompt() )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use test</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">auth</span>( <span class="lg-highlight-string">"myTestDBUser"</span>, <span class="lg-highlight-title lg-highlight-function">passwordPrompt</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"> You can omit the <code class="leafygreen-ui-1l06pbn"> password </code> value entirely to prompt the user to enter their password: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use test\ndb.auth( \"myTestDBUser\" )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use test</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">auth</span>( <span class="lg-highlight-string">"myTestDBUser"</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"> Starting in MongoDB 5.0, if your connection specifies the <code class="leafygreen-ui-1l06pbn"> --apiStrict </code> option, you may not use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.auth" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </span> </a> method to: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Authenticate again as the same user on the same database. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Authenticate as a different user when previously authenticated on the same database. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Authenticate with a new database when previously authenticated on a different database. </p> </li> </ul> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Authenticate when Connecting to the Shell <a class="headerlink leafygreen-ui-1kepx47" href="#authenticate-when-connecting-to-the-shell" 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="authenticate-when-connecting-to-the-shell"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Alternatively, you can use <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> 's command-line options <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-option-mongosh.--username" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --username </code> </span> </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-option-mongosh.--password" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --password </code> </span> </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-option-mongosh.--authenticationDatabase" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --authenticationDatabase </code> </span> </a> , and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-option-mongosh.--authenticationMechanism" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --authenticationMechanism </code> </span> </a> to specify authentication credentials when connecting <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> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh --username \"myTestDBUser\" --password --authenticationDatabase test --authenticationMechanism SCRAM-SHA-256","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">mongosh --username <span class="lg-highlight-string">"myTestDBUser"</span> --password --authenticationDatabase <span class="lg-highlight-built_in">test</span> --authenticationMechanism SCRAM-SHA-256</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> </section> </section> </section>
https://www.mongodb.com/docs/manual/core/replica-set-architecture-three-members/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Three Member Replica Sets <a class="headerlink leafygreen-ui-1kepx47" href="#three-member-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="three-member-replica-sets"> </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="#primary-with-two-secondary-members--p-s-s-" target="_self"> <span> Primary with Two Secondary Members (P-S-S) </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#primary-with-a-secondary-and-an-arbiter--psa-" target="_self"> <span> Primary with a Secondary and an Arbiter (PSA) </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> The minimum number of replica set members needed to obtain the benefits of a replica set is three members. A three member replica set can have either three data-bearing members (Primary-Secondary-Secondary) ( <em> Recommended </em> ) or if circumstances (such as cost) prohibit adding a third data bearing member, two data-bearing members and an arbiter (Primary-Secondary-Arbiter). <a class="footnote-reference header-buffer" href="#footnote-arbiter-considerations" id="ref-arbiter-considerations-id1"> [ <!-- --> 1 <!-- --> ] </a> </p> <table class="header-buffer leafygreen-ui-rbqgrl" frame="void" id="footnote-arbiter-considerations" rules="none"> <colgroup> <col/> </colgroup> <tbody valign="top"> <tr> <td class="leafygreen-ui-17r2xs0"> [ <a href="#ref-arbiter-considerations-id1"> 1 </a> ] </td> <td class="leafygreen-ui-17r2xs0"> <!-- --> For considerations when using an arbiter, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-arbiter/"> Replica Set Arbiter <!-- --> . </a> </td> </tr> </tbody> </table> <span class="leafygreen-ui-1qnjd6d" id="std-label-primary-two-secondary-members"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Primary with Two Secondary Members (P-S-S) <a class="headerlink leafygreen-ui-1kepx47" href="#primary-with-two-secondary-members--p-s-s-" 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="primary-with-two-secondary-members--p-s-s-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A replica set with three members that store data has: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> One <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-primary/#std-label-replica-set-primary"> primary <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Two <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-secondary/#std-label-replica-set-secondary-members-ref"> secondary </a> members. Both secondaries can become the primary in an <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-elections/#std-label-replica-set-election-internals"> election <!-- --> . </a> </p> </li> </ul> <div class="figure css-5vkxs0" style="width:700px"> <img alt="Diagram of a 3 member replica set that consists of a primary and two secondaries." class="leafygreen-ui-1qnf57e" height="280" src="/docs/manual/images/replica-set-primary-with-two-secondaries.bakedsvg.svg" style="--border-color:#C1C7C6" width="740"/> </div> <p class="leafygreen-ui-1kp3ins"> These deployments provide two complete copies of the data set at all times in addition to the primary. These replica sets provide additional fault tolerance and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-high-availability/#std-label-replica-set-failover"> high availability </a> . If the primary is unavailable, the replica set elects a secondary to be primary and continues normal operation. The old primary rejoins the set when available. </p> <div class="css-18h91be ej97su30"> <div role="button" tabindex="-1"> <img alt="Diagram of an election of a new primary. In a three member replica set with two secondaries, the primary becomes unreachable. The loss of a primary triggers an election where one of the secondaries becomes the new primary" class="leafygreen-ui-1qnf57e" height="500" src="/docs/manual/images/replica-set-trigger-election.bakedsvg.svg" style="--border-color:#C1C7C6" width="660"/> <div class="css-19pi7x2 ej97su31" style="--color:#444"> click to enlarge </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-rs-architecture-psa"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Primary with a Secondary and an Arbiter (PSA) <a class="headerlink leafygreen-ui-1kepx47" href="#primary-with-a-secondary-and-an-arbiter--psa-" 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="primary-with-a-secondary-and-an-arbiter--psa-"> </div> </a> </h2> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For considerations when using an arbiter, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-arbiter/"> Replica Set Arbiter <!-- --> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> A three member replica set with a two members that store data has: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> One <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-primary/#std-label-replica-set-primary"> primary <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> One <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-secondary/#std-label-replica-set-secondary-members-ref"> secondary </a> member. The secondary can become primary in an <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-elections/#std-label-replica-set-election-internals"> election <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> One <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-arbiter/#std-label-replica-set-arbiter-configuration"> arbiter </a> . The arbiter only votes in elections. </p> </li> </ul> <div class="figure css-5vkxs0" style="width:700px"> <img alt="Diagram of a replica set that consists of a primary, a secondary, and an arbiter." class="leafygreen-ui-1qnf57e" height="280" src="/docs/manual/images/replica-set-primary-with-secondary-and-arbiter.bakedsvg.svg" style="--border-color:#C1C7C6" width="740"/> </div> <p class="leafygreen-ui-1kp3ins"> Since the arbiter does not hold a copy of the data, these deployments provides only one complete copy of the data. Arbiters require fewer resources, but at the expense of more limited redundancy and fault tolerance. </p> <p class="leafygreen-ui-1kp3ins"> However, a deployment with a primary, secondary, and an arbiter ensures that a replica set remains available if the primary <em> or </em> the secondary is unavailable. If the primary is unavailable, the replica set will elect the secondary to be primary. </p> <div class="css-18h91be ej97su30"> <div role="button" tabindex="-1"> <img alt="Diagram of an election of a new primary. In a three member replica set with a secondary and an arbiter, the primary becomes unreachable. The loss of a primary triggers an election where the secondary becomes new primary." class="leafygreen-ui-1qnf57e" height="500" src="/docs/manual/images/replica-set-w-arbiter-trigger-election.bakedsvg.svg" style="--border-color:#C1C7C6" width="660"/> <div class="css-19pi7x2 ej97su31" style="--color:#444"> click to enlarge </div> </div> </div> <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/tutorial/deploy-replica-set/"> Deploy a Self-Managed Replica Set </a> </p> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/core/unsharded-collections/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Unsharded Collections <a class="headerlink leafygreen-ui-1kepx47" href="#unsharded-collections" 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="unsharded-collections"> </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="#command-syntax" target="_self"> <span> Command Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#use-cases" target="_self"> <span> Use Cases </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#get-started" target="_self"> <span> Get Started </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#access-control" target="_self"> <span> Access Control </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#details" target="_self"> <span> Details </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> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, you can unshard a sharded collection by using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/unshardCollection/#mongodb-dbcommand-dbcmd.unshardCollection"> <code class="leafygreen-ui-1l06pbn"> unshardCollection </code> </a> command. When you unshard a collection, MongoDB moves the collection data onto a single shard and updates the metadata to reflect the unsharded state. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Command Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#command-syntax" 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="command-syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To unshard a collection, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/unshardCollection/#mongodb-dbcommand-dbcmd.unshardCollection"> <code class="leafygreen-ui-1l06pbn"> unshardCollection </code> </a> command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand({\n unshardCollection : \"&lt;database&gt;.&lt;collection&gt;\",\n toShard : \"&lt;recipient&gt;\"\n})","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->unshardCollection <!-- -->: <span class="lg-highlight-string">"&lt;database&gt;.&lt;collection&gt;"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->toShard <!-- -->: <span class="lg-highlight-string">"&lt;recipient shard ID&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Use Cases <a class="headerlink leafygreen-ui-1kepx47" href="#use-cases" 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-cases"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A user can unshard a collection if: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can store the collection entirely on a single shard. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The collection requires resource isolation, and access patterns are better supported if the collection lives on a single shard. To meet the same requirements on a sharded collection, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/zone-sharding/#std-label-zone-sharding"> Zone Sharding <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The collection was previously sharded but no longer needs to be sharded. </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Get Started <a class="headerlink leafygreen-ui-1kepx47" href="#get-started" 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="get-started"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/unshard-collection/#std-label-unshard-collection-task"> Unshard a Collection </a> </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Access Control <a class="headerlink leafygreen-ui-1kepx47" href="#access-control" 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="access-control"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If your deployment has <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/#std-label-authorization"> access control </a> enabled, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-enableSharding"> <code class="leafygreen-ui-1l06pbn"> enableSharding </code> </a> role grants you access to run the <code class="leafygreen-ui-1l06pbn"> unshardCollection </code> command. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Details <a class="headerlink leafygreen-ui-1kepx47" href="#details" 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="details"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> An unsharded collection's data only lives on one shard and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key"> shard key </a> is removed. Collections that you manually unshard behave the same as newly created collections that were never sharded. </p> <p class="leafygreen-ui-1kp3ins"> You can specify the destination shard with the optional <code class="leafygreen-ui-1l06pbn"> toShard </code> field. If you don't specify a destination shard, MongoDB automatically selects the shard with the least amount of data. </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> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/moveable-collections/#std-label-moveable-collections"> Moveable Collections </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/unshardCollection/#mongodb-dbcommand-dbcmd.unshardCollection"> <code class="leafygreen-ui-1l06pbn"> unshardCollection </code> </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/core/indexes/index-types/geospatial/2d/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> 2d Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#2d-indexes" 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="2d-indexes"> </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="#use-cases" target="_self"> <span> Use Cases </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#get-started" target="_self"> <span> Get Started </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#details" target="_self"> <span> Details </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#supported-calculations" target="_self"> <span> Supported Calculations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#compound-2d-indexes" target="_self"> <span> Compound 2d Indexes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#sparse-property" target="_self"> <span> <code class="css-1kekw28 e1wawog0"> sparse </code> Property </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> <p class="leafygreen-ui-1kp3ins"> 2d indexes support queries on data stored as points on a <a class="leafygreen-ui-tqgtui" href="/docs/manual/geospatial-queries/#std-label-geospatial-geometry"> two-dimensional plane </a> . The 2d index is intended for queries on <a class="leafygreen-ui-tqgtui" href="/docs/manual/geospatial-queries/#std-label-geospatial-legacy"> legacy coordinate pairs <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To create a 2d index, specify the string <code class="leafygreen-ui-1l06pbn"> 2d </code> as the index type: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.&lt;collection&gt;.createIndex( { &lt;location&gt; : \"2d\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<!-- -->&lt;<!-- -->collection<!-- -->&gt;<!-- -->.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-tag lg-highlight-xml">&lt;</span><span class="lg-highlight-name lg-highlight-tag lg-highlight-xml">location</span><span class="lg-highlight-tag lg-highlight-xml"> </span><span class="lg-highlight-attr lg-highlight-tag lg-highlight-xml">field</span><span class="lg-highlight-tag lg-highlight-xml">&gt;</span><span class="lg-highlight-xml"> : "2d" } )</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"> You cannot use 2d indexes for queries on <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-GeoJSON"> GeoJSON </a> objects. To enable queries on GeoJSON objects, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere indexes <!-- --> . </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"> When creating a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-2d-index" target="_self"> <span> 2d index </span> </a> , the first value (longitude) must be between -180 and 180, inclusive. The second value (latitude) must be between -90 and 90, inclusive. However, these default limits can be overridden with the <code class="leafygreen-ui-1l06pbn"> min </code> and <code class="leafygreen-ui-1l06pbn"> max </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#std-label-2d-index-options"> options on 2d indexes </a> . Unlike <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere index </a> coordinates, <code class="leafygreen-ui-1l06pbn"> 2d indexes </code> values do not "wrap" around a sphere. </p> </div> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Use Cases <a class="headerlink leafygreen-ui-1kepx47" href="#use-cases" 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-cases"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Use a 2d index to query and perform calculation on data represented within a two-dimensional plane. For example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> An application analyzing visual similarities between two art pieces. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A calculator that can perform calculations on two-dimensional graphs. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A mobile game that calculates distances between players on a two-dimensional map. </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Get Started <a class="headerlink leafygreen-ui-1kepx47" href="#get-started" 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="get-started"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To learn how to create and query 2d indexes, see: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/create/#std-label-2d-index-create"> Create a 2d Index </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/query/proximity-flat-surface/#std-label-2d-index-proximity-query"> Query for Locations Near a Point on a Flat Surface </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/query/points-within-a-shape/#std-label-2d-index-query-within-flat-shape"> Query for Locations within a Shape on a Flat Surface </a> </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Details <a class="headerlink leafygreen-ui-1kepx47" href="#details" 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="details"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Supported Calculations <a class="headerlink leafygreen-ui-1kepx47" href="#supported-calculations" 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="supported-calculations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> 2d indexes support calculations on a <a class="leafygreen-ui-tqgtui" href="/docs/manual/geospatial-queries/#std-label-geospatial-geometry"> flat, Euclidean plane <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> For spherical geometry calculations, store your data as as <a class="leafygreen-ui-tqgtui" href="/docs/manual/geospatial-queries/#std-label-geospatial-geojson"> GeoJSON objects </a> and use a 2dsphere index to support geospatial queries. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Compound 2d Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#compound-2d-indexes" 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="compound-2d-indexes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can create compound 2d indexes that reference two fields: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The first field must be the location field. The index constructs queries that first select on this field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The second field further filters results based on additional criteria. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> A compound 2d index can cover queries. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> sparse </code> Property <a class="headerlink leafygreen-ui-1kepx47" href="#sparse-property" 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="sparse-property"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> 2d indexes are always <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-sparse/#std-label-index-type-sparse"> sparse </a> and ignore the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-sparse/#std-label-index-type-sparse"> sparse </a> option. If a document lacks a 2d index field (or the field is <code class="leafygreen-ui-1l06pbn"> null </code> or an empty array), MongoDB does not add an entry for the document to the 2d index. For inserts, MongoDB inserts the document but does not add to the 2d index. </p> <p class="leafygreen-ui-1kp3ins"> For a compound index that includes a 2d index key along with keys of other types, only the 2d index field determines whether the index references a document. </p> </section> </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> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/geospatial-queries/#std-label-geospatial-queries"> Geospatial Queries </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/query/#std-label-2dsphere-index-query"> Query a 2dsphere Index </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/restrictions/#std-label-geospatial-restrictions"> Geospatial Index Restrictions </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/update/bit/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $bit <a class="headerlink leafygreen-ui-1kepx47" href="#-bit" 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="-bit"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="update"> <dt> <code class="leafygreen-ui-1l06pbn"> $bit </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-update-up.-bit" 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-update-up.-bit"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-bit" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $bit </code> </span> </a> operator performs a bitwise update of a field. The operator supports bitwise <code class="leafygreen-ui-1l06pbn"> and </code> , bitwise <code class="leafygreen-ui-1l06pbn"> or </code> , and bitwise <code class="leafygreen-ui-1l06pbn"> xor </code> (i.e. exclusive or) operations. To specify a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-bit" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $bit </code> </span> </a> operator expression, use the following prototype: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $bit: { &lt;field&gt;: { &lt;and|or|xor&gt;: &lt;int&gt; } } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$bit</span>: <!-- -->{ &lt;<!-- -->field<!-- -->&gt;<!-- -->: <!-- -->{ <!-- -->&lt;and|or|xor&gt;: &lt;int&gt; } } }</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"> Only use this operator with integer fields (either 32-bit integer or 64-bit integer). </p> <p class="leafygreen-ui-1kp3ins"> To specify a <code class="leafygreen-ui-1l06pbn"> &lt;field&gt; </code> in an embedded document or in an array, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-dot-notation"> dot notation <!-- --> . </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"> All numbers 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> are doubles, not integers. To specify integers 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> , use the <code class="leafygreen-ui-1l06pbn"> NumberInt() </code> or the <code class="leafygreen-ui-1l06pbn"> NumberLong() </code> constructor. To learn more, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/data-types/#std-label-shell-type-int" target="_self"> <span> Int32 </span> </a> or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/data-types/#std-label-shell-type-long" target="_self"> <span> Long <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> To learn how your MongoDB driver handles numeric values, refer to your <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> driver's documentation <!-- --> . </span> </a> </p> </div> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> no longer raises an error when you use an update operator like <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-bit" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $bit </code> </span> </a> with an empty operand expression ( <code class="leafygreen-ui-1l06pbn"> { } </code> ). An empty update results in no changes and no <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> entry is created (meaning that the operation is a no-op). </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, update operators process document fields with string-based names in lexicographic order. Fields with numeric names are processed in numeric order. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-processing-order"> Update Operators Behavior </a> for details. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following examples use the <code class="leafygreen-ui-1l06pbn"> switches </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.switches.insertMany( [\n { _id: 1, expdata: Int32(13) },\n { _id: 2, expdata: Int32(3) },\n { _id: 3, expdata: Int32(1) }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">switches</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">expdata</span>: <span class="lg-highlight-title lg-highlight-class">Int32</span>(<span class="lg-highlight-number">13</span>) }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">expdata</span>: <span class="lg-highlight-title lg-highlight-class">Int32</span>(<span class="lg-highlight-number">3</span>) }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">expdata</span>: <span class="lg-highlight-title lg-highlight-class">Int32</span>(<span class="lg-highlight-number">1</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Bitwise AND <a class="headerlink leafygreen-ui-1kepx47" href="#bitwise-and" 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="bitwise-and"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use a bitwise <code class="leafygreen-ui-1l06pbn"> and </code> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#mongodb-method-db.collection.updateOne"> <code class="leafygreen-ui-1l06pbn"> updateOne() </code> </a> operation to update <code class="leafygreen-ui-1l06pbn"> expdata </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.switches.updateOne(\n { _id: 1 },\n { $bit: { expdata: { and: Int32( 10 ) } } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">switches</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$bit</span>: <!-- -->{ <span class="lg-highlight-attr">expdata</span>: <!-- -->{ <span class="lg-highlight-attr">and</span>: <span class="lg-highlight-title lg-highlight-class">Int32</span>( <span class="lg-highlight-number">10</span> ) } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The bitwise <code class="leafygreen-ui-1l06pbn"> and </code> operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> gets the bitwise value of <code class="leafygreen-ui-1l06pbn"> expdata </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses <code class="leafygreen-ui-1l06pbn"> and </code> to apply the bitwise value of Int32(10) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> updates <code class="leafygreen-ui-1l06pbn"> expdata </code> with the result, 1000 </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"1101 // expdata\n1010 // Int32(10)\n----\n1000","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-number">1101</span> <span class="lg-highlight-comment">// expdata</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-number">1010</span> <span class="lg-highlight-comment">// Int32(10)</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">-<!-- -->-<!-- -->-<!-- -->-</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-number">1000</span></td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Binary 1000 is equivalent to Int32(8). The <code class="leafygreen-ui-1l06pbn"> db.switches.find( { _id: 1 } ) </code> command returns the following document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"expdata\" : 8 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"expdata"</span> <!-- -->: <span class="lg-highlight-number">8</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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Bitwise OR <a class="headerlink leafygreen-ui-1kepx47" href="#bitwise-or" 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="bitwise-or"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use a bitwise <code class="leafygreen-ui-1l06pbn"> or </code> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#mongodb-method-db.collection.updateOne"> <code class="leafygreen-ui-1l06pbn"> updateOne() </code> </a> operation to update <code class="leafygreen-ui-1l06pbn"> expdata </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.switches.updateOne(\n { _id: 2 },\n { $bit: { expdata: { or: Int32( 5 ) } } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">switches</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$bit</span>: <!-- -->{ <span class="lg-highlight-attr">expdata</span>: <!-- -->{ <span class="lg-highlight-attr">or</span>: <span class="lg-highlight-title lg-highlight-class">Int32</span>( <span class="lg-highlight-number">5</span> ) } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The bitwise <code class="leafygreen-ui-1l06pbn"> or </code> operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> gets the bitwise value of <code class="leafygreen-ui-1l06pbn"> expdata </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses <code class="leafygreen-ui-1l06pbn"> or </code> to apply the bitwise value of Int32(5) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> updates <code class="leafygreen-ui-1l06pbn"> expdata </code> with the result, 0111 </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"0111 // expdata\n0101 // Int32(5)\n----\n0111","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-number">0111</span> <span class="lg-highlight-comment">// expdata</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-number">0101</span> <span class="lg-highlight-comment">// Int32(5)</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">-<!-- -->-<!-- -->-<!-- -->-</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-number">0111</span></td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Binary 0111 is equivalent to Int32(7). The <code class="leafygreen-ui-1l06pbn"> db.switches.find( { _id: 2 } ) </code> command returns the following document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 2, \"expdata\" : 7 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"expdata"</span> <!-- -->: <span class="lg-highlight-number">7</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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Bitwise XOR <a class="headerlink leafygreen-ui-1kepx47" href="#bitwise-xor" 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="bitwise-xor"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use a bitwise <code class="leafygreen-ui-1l06pbn"> xor </code> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#mongodb-method-db.collection.updateOne"> <code class="leafygreen-ui-1l06pbn"> updateOne() </code> </a> operation to update <code class="leafygreen-ui-1l06pbn"> expdata </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.switches.updateOne(\n { _id: 3 },\n { $bit: { expdata: { xor: Int32( 5 ) } } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">switches</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$bit</span>: <!-- -->{ <span class="lg-highlight-attr">expdata</span>: <!-- -->{ <span class="lg-highlight-attr">xor</span>: <span class="lg-highlight-title lg-highlight-class">Int32</span>( <span class="lg-highlight-number">5</span> ) } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The bitwise <code class="leafygreen-ui-1l06pbn"> and </code> operation: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> gets the bitwise value of <code class="leafygreen-ui-1l06pbn"> expdata </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> uses <code class="leafygreen-ui-1l06pbn"> and </code> to apply the bitwise value of Int32(5) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> updates <code class="leafygreen-ui-1l06pbn"> expdata </code> with the result, 0100 </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"0001 // expdata\n0101 // Int32(5)\n----\n0100","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-number">0001</span> <span class="lg-highlight-comment">// expdata</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-number">0101</span> <span class="lg-highlight-comment">// Int32(5)</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">-<!-- -->-<!-- -->-<!-- -->-</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-number">0100</span></td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Binary 0100 is equivalent to <code class="leafygreen-ui-1l06pbn"> Int32(4) </code> . The <code class="leafygreen-ui-1l06pbn"> db.switches.find( { _id: 3 } ) </code> command returns the following document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"expdata\" : 4 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"expdata"</span> <!-- -->: <span class="lg-highlight-number">4</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-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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#mongodb-method-db.collection.updateOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.updateOne() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findAndModify/#mongodb-method-db.collection.findAndModify"> <code class="leafygreen-ui-1l06pbn"> db.collection.findAndModify() </code> </a> </p> </li> </ul> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/database-profiler/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Database Profiler Output <a class="headerlink leafygreen-ui-1kepx47" href="#database-profiler-output" 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="database-profiler-output"> </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="#output-fields" target="_self"> <span> Output Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example-system.profile-document" target="_self"> <span> Example <code class="css-1kekw28 e1wawog0"> system.profile </code> Document </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> The database profiler captures data information about read and write operations, cursor operations, and database commands. To configure the database profile and set the thresholds for capturing profile data, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-the-database-profiler/#std-label-database-profiler"> Database Profiler </a> section. </p> <p class="leafygreen-ui-1kp3ins"> The database profiler writes data in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile"> <code class="leafygreen-ui-1l06pbn"> system.profile </code> </a> collection, which is a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-capped-collection"> capped collection </a> . To view the profiler's output, use normal MongoDB queries on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile"> <code class="leafygreen-ui-1l06pbn"> system.profile </code> </a> collection. </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"> Because the database profiler writes data to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile"> <code class="leafygreen-ui-1l06pbn"> system.profile </code> </a> collection in a database, the profiler profiles some write activity, even for databases that are otherwise read-only. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-dbcommand-dbcmd.currentOp"> <code class="leafygreen-ui-1l06pbn"> currentOp </code> </a> and the database profiler report the same basic diagnostic information for CRUD operations, including the following: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/aggregate/#mongodb-dbcommand-dbcmd.aggregate"> <code class="leafygreen-ui-1l06pbn"> aggregate </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/count/#mongodb-dbcommand-dbcmd.count"> <code class="leafygreen-ui-1l06pbn"> count </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/delete/#mongodb-dbcommand-dbcmd.delete"> <code class="leafygreen-ui-1l06pbn"> delete </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/distinct/#mongodb-dbcommand-dbcmd.distinct"> <code class="leafygreen-ui-1l06pbn"> distinct </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> find </code> ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/legacy-opcodes/#std-label-wire-op-query"> OP_QUERY </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/find/#mongodb-dbcommand-dbcmd.find"> <code class="leafygreen-ui-1l06pbn"> command </code> ) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/findAndModify/#mongodb-dbcommand-dbcmd.findAndModify"> <code class="leafygreen-ui-1l06pbn"> findAndModify </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> getMore </code> ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/legacy-opcodes/#std-label-wire-op-query"> OP_GET_MORE </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getMore/#mongodb-dbcommand-dbcmd.getMore"> <code class="leafygreen-ui-1l06pbn"> command </code> ) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/insert/#mongodb-dbcommand-dbcmd.insert"> <code class="leafygreen-ui-1l06pbn"> insert </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/mapReduce/#mongodb-dbcommand-dbcmd.mapReduce"> <code class="leafygreen-ui-1l06pbn"> mapReduce </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/update/#mongodb-dbcommand-dbcmd.update"> <code class="leafygreen-ui-1l06pbn"> update </code> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> These operations are also included in the logging of slow queries. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-operationProfiling.slowOpThresholdMs"> <code class="leafygreen-ui-1l06pbn"> slowOpThresholdMs </code> </a> for more information about slow query logging. </p> <p class="leafygreen-ui-1kp3ins"> When using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/#std-label-qe-manual-feature-qe"> Queryable Encryption </a> , CRUD operations against encrypted collections are omitted from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile"> <code class="leafygreen-ui-1l06pbn"> system.profile </code> </a> collection. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/limitations/#std-label-qe-redaction"> Redaction <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> It is no longer possible to perform any operation, including reads, on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile"> <code class="leafygreen-ui-1l06pbn"> system.profile </code> </a> collection from within a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions"> transaction <!-- --> . </a> </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Do not attempt to create a time series collection or view with the name <code class="leafygreen-ui-1l06pbn"> system.profile </code> . MongoDB 6.3 and later versions return an <code class="leafygreen-ui-1l06pbn"> IllegalOperation </code> error if you attempt to do so. <strong> Earlier MongoDB versions crash. </strong> </p> </div> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Output Fields <a class="headerlink leafygreen-ui-1kepx47" href="#output-fields" 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-fields"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> For any single operation, the documents created by the database profiler includes a subset of the following fields. The precise selection of fields in these documents depends on the type of operation. </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"> For the output specific to the version of your MongoDB, refer to the appropriate version of the MongoDB Manual. </p> </div> </div> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.op </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.op" 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-data-system.profile.op"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The type of operation. The possible values are: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> command </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> count </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> distinct </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> geoNear </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> getMore </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> group </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> insert </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> mapReduce </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> query </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> remove </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> update </code> </p> </li> </ul> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.ns </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.ns" 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-data-system.profile.ns"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-namespace"> namespace </a> the operation targets. Namespaces in MongoDB take the form of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-database"> database </a> , followed by a dot ( <code class="leafygreen-ui-1l06pbn"> . </code> ), followed by the name of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-collection"> collection <!-- --> . </a> </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.command </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.command" 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-data-system.profile.command"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A document containing the full command object associated with this operation. </p> <p class="leafygreen-ui-1kp3ins"> For example, the following output contains the command object for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/find/#mongodb-dbcommand-dbcmd.find"> <code class="leafygreen-ui-1l06pbn"> find </code> </a> operation on a collection named <code class="leafygreen-ui-1l06pbn"> items </code> in a database named <code class="leafygreen-ui-1l06pbn"> test </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"command\" : {\n \"find\" : \"items\",\n \"filter\" : {\n \"sku\" : 1403978\n },\n ...\n \"$db\" : \"test\"\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string">"command"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"find"</span> <!-- -->: <span class="lg-highlight-string">"items"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"filter"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"sku"</span> <!-- -->: <span class="lg-highlight-number">1403978</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$db"</span> <!-- -->: <span class="lg-highlight-string">"test"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example output contains the command object for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getMore/#mongodb-dbcommand-dbcmd.getMore"> <code class="leafygreen-ui-1l06pbn"> getMore </code> </a> operation generated by a command with cursor ID <code class="leafygreen-ui-1l06pbn"> 19234103609 </code> on a collection named <code class="leafygreen-ui-1l06pbn"> items </code> in a database named <code class="leafygreen-ui-1l06pbn"> test </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"command\" : {\n \"getMore\" : NumberLong(\"19234103609\"),\n \"collection\" : \"items\",\n \"batchSize\" : 10,\n ...\n \"$db\" : \"test\"\n},","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string">"command"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"getMore"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-string">"19234103609"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"collection"</span> <!-- -->: <span class="lg-highlight-string">"items"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"batchSize"</span> <!-- -->: <span class="lg-highlight-number">10</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$db"</span> <!-- -->: <span class="lg-highlight-string">"test"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If the command document exceeds 50 kilobytes, the document has the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"command\" : {\n \"$truncated\": &lt;string&gt;,\n \"comment\": &lt;string&gt;\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string">"command"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$truncated"</span>: &lt;<!-- -->string<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"comment"</span>: &lt;<!-- -->string<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> $truncated </code> field contains a string summary of the document excluding the document's <code class="leafygreen-ui-1l06pbn"> comment </code> field if present. If the summary still exceeds 50 kilobytes then it is further truncated, denoted by an ellipsis (...) at the end of the string. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> comment </code> field is present if a comment was passed to the operation. A comment may be attached to any <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/#std-label-database-commands"> database command <!-- --> . </a> </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.originatingCommand </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.originatingCommand" 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-data-system.profile.originatingCommand"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> For <code class="leafygreen-ui-1l06pbn"> "getmore" </code> operations which retrieve the next batch of results from a cursor, the <code class="leafygreen-ui-1l06pbn"> originatingCommand </code> field contains the full command object (e.g. <code class="leafygreen-ui-1l06pbn"> find </code> or <code class="leafygreen-ui-1l06pbn"> aggregate </code> ) which originally created that cursor. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.cursorid </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.cursorid" 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-data-system.profile.cursorid"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The ID of the cursor accessed by a <code class="leafygreen-ui-1l06pbn"> query </code> and <code class="leafygreen-ui-1l06pbn"> getmore </code> operations. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.keysExamined </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.keysExamined" 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-data-system.profile.keysExamined"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The number of <a class="leafygreen-ui-tqgtui" href="/docs/manual/indexes/#std-label-indexes"> index </a> keys that MongoDB scanned in order to carry out the operation. </p> <p class="leafygreen-ui-1kp3ins"> In general, if <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.keysExamined" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> keysExamined </code> </span> </a> is much higher than <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.nreturned" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> nreturned </code> </span> </a> , the database is scanning many index keys to find the result documents. Consider creating or adjusting indexes to improve query performance.. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> keysExamined </code> is available for the following commands and operations: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/aggregate/#mongodb-dbcommand-dbcmd.aggregate"> <code class="leafygreen-ui-1l06pbn"> aggregate </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> find </code> ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/legacy-opcodes/#std-label-wire-op-query"> OP_QUERY </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/find/#mongodb-dbcommand-dbcmd.find"> <code class="leafygreen-ui-1l06pbn"> command </code> ) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/findAndModify/#mongodb-dbcommand-dbcmd.findAndModify"> <code class="leafygreen-ui-1l06pbn"> findAndModify </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/count/#mongodb-dbcommand-dbcmd.count"> <code class="leafygreen-ui-1l06pbn"> count </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/distinct/#mongodb-dbcommand-dbcmd.distinct"> <code class="leafygreen-ui-1l06pbn"> distinct </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> getMore </code> ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/legacy-opcodes/#std-label-wire-op-query"> OP_GET_MORE </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getMore/#mongodb-dbcommand-dbcmd.getMore"> <code class="leafygreen-ui-1l06pbn"> command </code> ) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/mapReduce/#mongodb-dbcommand-dbcmd.mapReduce"> <code class="leafygreen-ui-1l06pbn"> mapReduce </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/delete/#mongodb-dbcommand-dbcmd.delete"> <code class="leafygreen-ui-1l06pbn"> delete </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/update/#mongodb-dbcommand-dbcmd.update"> <code class="leafygreen-ui-1l06pbn"> update </code> </a> </p> </li> </ul> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.docsExamined </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.docsExamined" 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-data-system.profile.docsExamined"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The number of documents in the collection that MongoDB scanned in order to carry out the operation. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> docsExamined </code> is available for the following commands and operations: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/aggregate/#mongodb-dbcommand-dbcmd.aggregate"> <code class="leafygreen-ui-1l06pbn"> aggregate </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> find </code> ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/legacy-opcodes/#std-label-wire-op-query"> OP_QUERY </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/find/#mongodb-dbcommand-dbcmd.find"> <code class="leafygreen-ui-1l06pbn"> command </code> ) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/findAndModify/#mongodb-dbcommand-dbcmd.findAndModify"> <code class="leafygreen-ui-1l06pbn"> findAndModify </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/count/#mongodb-dbcommand-dbcmd.count"> <code class="leafygreen-ui-1l06pbn"> count </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/distinct/#mongodb-dbcommand-dbcmd.distinct"> <code class="leafygreen-ui-1l06pbn"> distinct </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> getMore </code> ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/legacy-opcodes/#std-label-wire-op-query"> OP_GET_MORE </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getMore/#mongodb-dbcommand-dbcmd.getMore"> <code class="leafygreen-ui-1l06pbn"> command </code> ) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/mapReduce/#mongodb-dbcommand-dbcmd.mapReduce"> <code class="leafygreen-ui-1l06pbn"> mapReduce </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/delete/#mongodb-dbcommand-dbcmd.delete"> <code class="leafygreen-ui-1l06pbn"> delete </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/update/#mongodb-dbcommand-dbcmd.update"> <code class="leafygreen-ui-1l06pbn"> update </code> </a> </p> </li> </ul> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.hasSortStage </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.hasSortStage" 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-data-system.profile.hasSortStage"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.hasSortStage" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> hasSortStage </code> </span> </a> is a boolean that is <code class="leafygreen-ui-1l06pbn"> true </code> when a query <strong> cannot </strong> use the ordering in the index to return the requested sorted results; i.e. MongoDB must sort the documents after it receives the documents from a cursor. The field only appears when the value is <code class="leafygreen-ui-1l06pbn"> true </code> . </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> hasSortStage </code> is available for the following commands and operations: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> find </code> ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/legacy-opcodes/#std-label-wire-op-query"> OP_QUERY </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/find/#mongodb-dbcommand-dbcmd.find"> <code class="leafygreen-ui-1l06pbn"> command </code> ) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> getMore </code> ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/legacy-opcodes/#std-label-wire-op-query"> OP_GET_MORE </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getMore/#mongodb-dbcommand-dbcmd.getMore"> <code class="leafygreen-ui-1l06pbn"> command </code> ) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/findAndModify/#mongodb-dbcommand-dbcmd.findAndModify"> <code class="leafygreen-ui-1l06pbn"> findAndModify </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/mapReduce/#mongodb-dbcommand-dbcmd.mapReduce"> <code class="leafygreen-ui-1l06pbn"> mapReduce </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/aggregate/#mongodb-dbcommand-dbcmd.aggregate"> <code class="leafygreen-ui-1l06pbn"> aggregate </code> </a> </p> </li> </ul> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.usedDisk </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.usedDisk" 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-data-system.profile.usedDisk"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A boolean that indicates whether any aggregation stage wrote data to temporary files due to <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/aggregation-pipeline-limits/#std-label-agg-memory-restrictions"> memory restrictions <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Only appears if <code class="leafygreen-ui-1l06pbn"> usedDisk </code> is true. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.ndeleted </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.ndeleted" 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-data-system.profile.ndeleted"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The number of documents deleted by the operation. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.ninserted </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.ninserted" 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-data-system.profile.ninserted"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The number of documents inserted by the operation. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.nMatched </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.nMatched" 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-data-system.profile.nMatched"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The number of documents that match the query condition for the update operation. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.nModified </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.nModified" 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-data-system.profile.nModified"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The number of documents modified by the update operation. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.upsert </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.upsert" 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-data-system.profile.upsert"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A boolean that indicates the update operation's <code class="leafygreen-ui-1l06pbn"> upsert </code> option value. Only appears if <code class="leafygreen-ui-1l06pbn"> upsert </code> is true. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.fromMultiPlanner </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.fromMultiPlanner" 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-data-system.profile.fromMultiPlanner"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A boolean that indicates whether the query planner evaluated multiple plans before choosing the winning execution plan for the query. </p> <p class="leafygreen-ui-1kp3ins"> Only present when value is <code class="leafygreen-ui-1l06pbn"> true </code> . </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.replanned </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.replanned" 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-data-system.profile.replanned"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A boolean that indicates whether the query system evicted a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-plans/#std-label-query-plans-query-optimization"> cached plan </a> and re-evaluated all candidate plans. </p> <p class="leafygreen-ui-1kp3ins"> Only present when value is <code class="leafygreen-ui-1l06pbn"> true </code> . </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.replanReason </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.replanReason" 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-data-system.profile.replanReason"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A string that indicates the specific reason a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-plans/#std-label-query-plans-query-optimization"> cached plan </a> was evicted. </p> <p class="leafygreen-ui-1kp3ins"> Only present when value for <code class="leafygreen-ui-1l06pbn"> replanned </code> is <code class="leafygreen-ui-1l06pbn"> true </code> . </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.keysInserted </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.keysInserted" 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-data-system.profile.keysInserted"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The number of index keys inserted for a given write operation. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.writeConflicts </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.writeConflicts" 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-data-system.profile.writeConflicts"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The number of conflicts encountered during the write operation; e.g. an <code class="leafygreen-ui-1l06pbn"> update </code> operation attempts to modify the same document as another <code class="leafygreen-ui-1l06pbn"> update </code> operation. See also <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-write-conflict"> write conflict <!-- --> . </a> </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.numYield </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.numYield" 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-data-system.profile.numYield"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The number of times the operation yielded to allow other operations to complete. Typically, operations yield when they need access to data that MongoDB has not yet fully read into memory. This allows other operations that have data in memory to complete while MongoDB reads in data for the yielding operation. For more information, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/faq/concurrency/#std-label-faq-concurrency-yielding"> the FAQ on when operations yield <!-- --> . </a> </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.queryHash </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.queryHash" 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-data-system.profile.queryHash"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, the pre-existing <code class="leafygreen-ui-1l06pbn"> queryHash </code> field is renamed to <code class="leafygreen-ui-1l06pbn"> planCacheShapeHash </code> . If you're using an earlier MongoDB version, you'll see <code class="leafygreen-ui-1l06pbn"> queryHash </code> instead of <code class="leafygreen-ui-1l06pbn"> planCacheShapeHash </code> . </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.queryShapeHash </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.queryShapeHash" 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-data-system.profile.queryShapeHash"> </div> </a> </dt> <dd> <div> <p> <em> New <!-- --> in version <!-- --> 8.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> queryShapeHash </code> is a hexadecimal string with the hash of a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-query-shape"> query shape </a> . For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-shapes/#std-label-query-shapes"> Query Shapes <!-- --> . </a> </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.planCacheShapeHash </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.planCacheShapeHash" 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-data-system.profile.planCacheShapeHash"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A hexadecimal string that represents a hash of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-plan-cache-query-shape"> plan cache query shape </a> and is dependent only on the plan cache query shape. <code class="leafygreen-ui-1l06pbn"> planCacheShapeHash </code> can help identify slow queries, including the query filter of write operations, with the same plan cache query shape. </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"> As with any hash function, two different plan cache query shapes may result in the same hash value. However, the occurrence of hash collisions between different plan cache query shapes is unlikely. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information about <code class="leafygreen-ui-1l06pbn"> planCacheShapeHash </code> and <code class="leafygreen-ui-1l06pbn"> planCacheKey </code> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-plans/#std-label-query-hash-plan-cache-key"> planCacheShapeHash and planCacheKey <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, the pre-existing <code class="leafygreen-ui-1l06pbn"> queryHash </code> field is renamed to <code class="leafygreen-ui-1l06pbn"> planCacheShapeHash </code> . If you're using an earlier MongoDB version, you'll see <code class="leafygreen-ui-1l06pbn"> queryHash </code> instead of <code class="leafygreen-ui-1l06pbn"> planCacheShapeHash </code> . </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.planCacheKey </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.planCacheKey" 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-data-system.profile.planCacheKey"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A hash of the key for the plan cache entry associated with the query. </p> <p class="leafygreen-ui-1kp3ins"> Unlike <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.planCacheShapeHash" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> planCacheShapeHash </code> </span> </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.planCacheKey" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> planCacheKey </code> </span> </a> is a function of both the plan cache query shape and the currently available indexes for that shape. Specifically, if indexes that can support the query shape are added or dropped, the <code class="leafygreen-ui-1l06pbn"> planCacheKey </code> value may change but <code class="leafygreen-ui-1l06pbn"> planCacheShapeHash </code> would not. </p> <p class="leafygreen-ui-1kp3ins"> For more information about <code class="leafygreen-ui-1l06pbn"> planCacheShapeHash </code> and <code class="leafygreen-ui-1l06pbn"> planCacheKey </code> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-plans/#std-label-query-hash-plan-cache-key"> planCacheShapeHash and planCacheKey <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, the pre-existing <code class="leafygreen-ui-1l06pbn"> queryHash </code> field is renamed to <code class="leafygreen-ui-1l06pbn"> planCacheShapeHash </code> . If you're using an earlier MongoDB version, you'll see <code class="leafygreen-ui-1l06pbn"> queryHash </code> instead of <code class="leafygreen-ui-1l06pbn"> planCacheShapeHash </code> . </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.queryFramework </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.queryFramework" 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-data-system.profile.queryFramework"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-query-framework"> query framework </a> used to process an operation. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.locks </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.locks" 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-data-system.profile.locks"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.locks" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> system.profile.locks </code> </span> </a> provides information for various <a class="leafygreen-ui-tqgtui" href="/docs/manual/faq/concurrency/#std-label-faq-concurrency-locking"> lock types and lock modes </a> held during the operation. </p> <p class="leafygreen-ui-1kp3ins"> The possible lock types are: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Lock Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> ParallelBatchWriterMode </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Represents a lock for parallel batch writer mode. </p> <p class="leafygreen-ui-1kp3ins"> In earlier versions, PBWM information was reported as part of the <code class="leafygreen-ui-1l06pbn"> Global </code> lock information. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> ReplicationStateTransition </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Represents lock taken for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-states/"> replica set member state </a> transitions. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> Global </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Represents global lock. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> Database </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Represents database lock. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> Collection </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Represents collection lock. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> Mutex </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Represents mutex. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> Metadata </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Represents metadata lock. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> DDLDatabase </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Represents a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-DDL--Data-Definition-Language-"> DDL </a> database lock. </p> <div> <p> <em> New <!-- --> in version <!-- --> 7.1 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> DDLCollection </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Represents a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-DDL--Data-Definition-Language-"> DDL </a> collection lock. </p> <div> <p> <em> New <!-- --> in version <!-- --> 7.1 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> oplog </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Represents lock on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog <!-- --> . </a> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> The possible locking modes for the lock types are as follows: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Lock Mode </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> R </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Represents Shared (S) lock. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> W </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Represents Exclusive (X) lock. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> r </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Represents Intent Shared (IS) lock. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> w </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Represents Intent Exclusive (IX) lock. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> The returned lock information for the various lock types include: </p> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.locks.acquireCount </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.locks.acquireCount" 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-data-system.profile.locks.acquireCount"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Number of times the operation acquired the lock in the specified mode. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.locks.acquireWaitCount </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.locks.acquireWaitCount" 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-data-system.profile.locks.acquireWaitCount"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Number of times the operation had to wait for the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.locks.acquireCount" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> acquireCount </code> </span> </a> lock acquisitions because the locks were held in a conflicting mode. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.locks.acquireWaitCount" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> acquireWaitCount </code> </span> </a> is less than or equal to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.locks.acquireCount" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> acquireCount </code> . </span> </a> </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.locks.timeAcquiringMicros </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.locks.timeAcquiringMicros" 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-data-system.profile.locks.timeAcquiringMicros"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Cumulative time in microseconds that the operation had to wait to acquire the locks. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.locks.timeAcquiringMicros" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> timeAcquiringMicros </code> </span> </a> divided by <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.locks.acquireWaitCount" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> acquireWaitCount </code> </span> </a> gives an approximate average wait time for the particular lock mode. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.locks.deadlockCount </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.locks.deadlockCount" 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-data-system.profile.locks.deadlockCount"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Number of times the operation encountered deadlocks while waiting for lock acquisitions. </p> </dd> </dl> <p class="leafygreen-ui-1kp3ins"> For more information on lock modes, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/faq/concurrency/#std-label-faq-concurrency-locking"> What type of locking does MongoDB use? <!-- --> . </a> </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.authorization </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.authorization" 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-data-system.profile.authorization"> </div> </a> </dt> <dd> <div> <p> <em> New <!-- --> in version <!-- --> 5.0.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> The number of times the user cache is accessed for each operation. These metrics are only displayed when an operation has accessed the user cache at least once. </p> <p class="leafygreen-ui-1kp3ins"> These metrics are only available when <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-message-slow-ops"> slow operation logging </a> or database profiling is enabled. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.authorization" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> system.profile.authorization </code> </span> </a> is not included in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.currentOp/#mongodb-method-db.currentOp"> <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> </a> output. </p> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.authorization.startedUserCacheAcquisitionAttempts </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.authorization.startedUserCacheAcquisitionAttempts" 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-data-system.profile.authorization.startedUserCacheAcquisitionAttempts"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The number of times the operation tried to access the user cache. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.authorization.completedUserCacheAcquisitionAttempts </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.authorization.completedUserCacheAcquisitionAttempts" 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-data-system.profile.authorization.completedUserCacheAcquisitionAttempts"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The number of times the operation retrieved user data from the user cache. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.authorization.userCacheWaitTimeMicros </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.authorization.userCacheWaitTimeMicros" 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-data-system.profile.authorization.userCacheWaitTimeMicros"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The total time the operation spent waiting for user cache responses. </p> </dd> </dl> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.storage </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.storage" 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-data-system.profile.storage"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.storage" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> system.profile.storage </code> </span> </a> information provides metrics on the storage engine data and wait time for the operation. </p> <p class="leafygreen-ui-1kp3ins"> Specific storage metrics are returned only if the values are greater than zero. </p> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.storage.data.bytesRead </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.storage.data.bytesRead" 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-data-system.profile.storage.data.bytesRead"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Number of bytes read by the operation from the disk to the cache. </p> <p class="leafygreen-ui-1kp3ins"> Data read from disk into the cache includes everything needed to execute the query. If the data is already in the cache, then the number of bytes read from disk could be <code class="leafygreen-ui-1l06pbn"> 0 </code> . </p> <p class="leafygreen-ui-1kp3ins"> The number of bytes read from disk includes more than the queried documents: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> WiredTiger reads in units of pages and a page may contain one or several documents. If a document is in a page, all documents in that page are read into the cache and included in the <code class="leafygreen-ui-1l06pbn"> bytesRead </code> value. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the cache requires page management (such as eviction or rereads), the <code class="leafygreen-ui-1l06pbn"> bytesRead </code> value includes data read from disk in these operations. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the index is not in the cache or the index in the cache is stale, WiredTiger reads several internal and leaf pages from disk to reconstruct the index in cache. </p> </li> </ul> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.storage.data.timeReadingMicros </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.storage.data.timeReadingMicros" 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-data-system.profile.storage.data.timeReadingMicros"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Time in microseconds that the operation had to spend to read from the disk. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.storage.data.bytesWritten </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.storage.data.bytesWritten" 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-data-system.profile.storage.data.bytesWritten"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Number of bytes written by the operation from the cache to the disk. </p> <p class="leafygreen-ui-1kp3ins"> WiredTiger typically doesn't require the query to write to disk. Data modified by the query is written to an in-memory cache that WiredTiger flushes to disk as part an eviction or checkpoint operation. In such cases, <code class="leafygreen-ui-1l06pbn"> bytesWritten </code> shows as 0. </p> <p class="leafygreen-ui-1kp3ins"> If the thread running the query requires forced page management (such as eviction), WiredTiger writes the page contents to disk. This flush likely includes data unrelated to changes made by the query itself, which can cause <code class="leafygreen-ui-1l06pbn"> bytesWritten </code> to show a higher value than expected. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.storage.data.timeWritingMicros </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.storage.data.timeWritingMicros" 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-data-system.profile.storage.data.timeWritingMicros"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Time in microseconds that the operation had to spend to write to the disk. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.storage.timeWaitingMicros.cache </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.storage.timeWaitingMicros.cache" 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-data-system.profile.storage.timeWaitingMicros.cache"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Time in microseconds that the operation had to wait for space in the cache. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.storage.timeWaitingMicros.schemaLock </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.storage.timeWaitingMicros.schemaLock" 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-data-system.profile.storage.timeWaitingMicros.schemaLock"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Time in microseconds that the operation (if modifying the schema) had to wait to acquire a schema lock. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.storage.timeWaitingMicros.handleLock </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.storage.timeWaitingMicros.handleLock" 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-data-system.profile.storage.timeWaitingMicros.handleLock"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Time in microseconds that the operation had to wait to acquire the a lock on the needed data handles. </p> </dd> </dl> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.nreturned </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.nreturned" 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-data-system.profile.nreturned"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The number of documents returned by the operation. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.responseLength </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.responseLength" 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-data-system.profile.responseLength"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The length in bytes of the operation's result document. A large <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.responseLength" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> responseLength </code> </span> </a> can affect performance. To limit the size of the result document for a query operation, you can use any of the following: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/project-fields-from-query-results/#std-label-read-operations-projection"> Projections </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.limit/#mongodb-method-cursor.limit"> <code class="leafygreen-ui-1l06pbn"> The limit() method </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.batchSize/#mongodb-method-cursor.batchSize"> <code class="leafygreen-ui-1l06pbn"> The batchSize() method </code> </a> </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> When MongoDB writes query profile information to the log, the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.responseLength" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> responseLength </code> </span> </a> value is in a field named <code class="leafygreen-ui-1l06pbn"> reslen </code> . </p> </div> </div> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.cpuNanos </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.cpuNanos" 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-data-system.profile.cpuNanos"> </div> </a> </dt> <dd> <div> <p> <em> New <!-- --> in version <!-- --> 6.3 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> The total CPU time spent by a query operation in nanoseconds. This field is only available on Linux systems. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.protocol </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.protocol" 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-data-system.profile.protocol"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-wire-protocol/#std-label-mongodb-wire-protocol"> MongoDB Wire Protocol </a> request message format. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.millis </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.millis" 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-data-system.profile.millis"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The time in milliseconds from the perspective of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> from the beginning of the operation to the end of the operation. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> planningTimeMicros </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-planningTimeMicros" 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-data-planningTimeMicros"> </div> </a> </dt> <dd> <div> <p> <em> New <!-- --> in version <!-- --> 6.2 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> The time, in microseconds, that the <code class="leafygreen-ui-1l06pbn"> find </code> or <code class="leafygreen-ui-1l06pbn"> aggregate </code> command spent in <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-plans/#std-label-query-plans-query-optimization"> query planning <!-- --> . </a> </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.planSummary </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.planSummary" 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-data-system.profile.planSummary"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A summary of the execution plan. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.execStats </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.execStats" 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-data-system.profile.execStats"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A document that contains the execution statistics of the query operation. For other operations, the value is an empty document. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.execStats" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> system.profile.execStats </code> </span> </a> presents the statistics as a tree; each node provides the statistics for the operation executed during that stage of the query operation. </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"> The following fields list for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-system.profile.execStats" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> execStats </code> </span> </a> is not meant to be exhaustive as the returned fields vary per stage. </p> </div> </div> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.execStats.stage </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.execStats.stage" 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-data-system.profile.execStats.stage"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The descriptive name for the operation performed as part of the query execution; e.g. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> COLLSCAN </code> for a collection scan </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> IXSCAN </code> for scanning index keys </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> FETCH </code> for retrieving documents </p> </li> </ul> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.execStats.inputStages </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.execStats.inputStages" 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-data-system.profile.execStats.inputStages"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> An array that contains statistics for the operations that are the input stages of the current stage. </p> </dd> </dl> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.ts </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.ts" 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-data-system.profile.ts"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The timestamp of the operation. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.client </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.client" 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-data-system.profile.client"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The IP address or hostname of the client connection where the operation originates. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.appName </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.appName" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-system.profile.appName"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The identifier of the client application which ran the operation. Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string-options/#mongodb-urioption-urioption.appName"> <code class="leafygreen-ui-1l06pbn"> appName </code> </a> connection string option to set a custom value for the <code class="leafygreen-ui-1l06pbn"> appName </code> field. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.allUsers </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.allUsers" 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-data-system.profile.allUsers"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> An array of authenticated user information (user name and database) for the session. See also <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-users/#std-label-users"> Users in Self-Managed Deployments <!-- --> . </a> </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> system.profile.user </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-system.profile.user" 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-data-system.profile.user"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The authenticated user who ran the operation. If the operation was not run by an authenticated user, this field's value is an empty string. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <code class="leafygreen-ui-1l06pbn"> system.profile </code> Document <a class="headerlink leafygreen-ui-1kepx47" href="#example-system.profile-document" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example-system.profile-document"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following examples present sample documents found in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile"> <code class="leafygreen-ui-1l06pbn"> system.profile </code> </a> collection for operations on a standalone: </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-63"> <div aria-label="Tabs to describe usage of getmore/query/update" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_a7uuz73hn" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_gpqmiwk1o" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Find Operation </div> </button> <button aria-controls="_mplblnh2l" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_70o1qrtnw" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Get More Operation </div> </button> <button aria-controls="_ip9ct3nl1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_cr964mucn" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Update Operation </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_0m33p3ulb" class="" id="_9tgeaisbz" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following document in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile"> <code class="leafygreen-ui-1l06pbn"> system.profile </code> </a> collection shows metrics for a sample query operation on the <code class="leafygreen-ui-1l06pbn"> test.report </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"op\" : \"query\",\n \"ns\" : \"test.report\",\n \"command\" : {\n \"find\" : \"report\",\n \"filter\" : { \"a\" : { \"$lte\" : 500 } },\n \"lsid\" : {\n \"id\" : UUID(\"5ccd5b81-b023-41f3-8959-bf99ed696ce9\")\n },\n \"$db\" : \"test\"\n },\n \"cursorid\" : 33629063128,\n \"keysExamined\" : 101,\n \"docsExamined\" : 101,\n \"fromMultiPlanner\" : true,\n \"numYield\" : 2,\n \"nreturned\" : 101,\n \"planCacheShapeHash\" : \"811451DD\",\n \"planCacheKey\" : \"759981BA\",\n \"queryFramework\" : \"classic\",\n \"locks\" : {\n \"Global\" : {\n \"acquireCount\" : {\n \"r\" : NumberLong(3),\n \"w\" : NumberLong(3)\n }\n },\n \"Database\" : {\n \"acquireCount\" : { \"r\" : NumberLong(3) },\n \"acquireWaitCount\" : { \"r\" : NumberLong(1) },\n \"timeAcquiringMicros\" : { \"r\" : NumberLong(69130694) }\n },\n \"Collection\" : {\n \"acquireCount\" : { \"r\" : NumberLong(3) }\n }\n },\n \"storage\" : {\n \"data\" : {\n \"bytesRead\" : NumberLong(14736),\n \"timeReadingMicros\" : NumberLong(17)\n }\n },\n \"responseLength\" : 1305014,\n \"protocol\" : \"op_msg\",\n \"millis\" : 69132,\n \"planningTimeMicros\" : 129,\n \"planSummary\" : \"IXSCAN { a: 1, _id: -1 }\",\n \"execStats\" : {\n \"stage\" : \"FETCH\",\n \"nReturned\" : 101,\n \"executionTimeMillisEstimate\" : 0,\n \"works\" : 101,\n \"advanced\" : 101,\n \"needTime\" : 0,\n \"needYield\" : 0,\n \"saveState\" : 3,\n \"restoreState\" : 2,\n \"isEOF\" : 0,\n \"docsExamined\" : 101,\n \"alreadyHasObj\" : 0,\n \"inputStage\" : {\n ...\n }\n },\n \"ts\" : ISODate(\"2019-01-14T16:57:33.450Z\"),\n \"client\" : \"127.0.0.1\",\n \"appName\" : \"MongoDB Shell\",\n \"allUsers\" : [\n {\n \"user\" : \"someuser\",\n \"db\" : \"admin\"\n }\n ],\n \"user\" : \"someuser@admin\"\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"op"</span> <!-- -->: <span class="lg-highlight-string">"query"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ns"</span> <!-- -->: <span class="lg-highlight-string">"test.report"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"command"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"find"</span> <!-- -->: <span class="lg-highlight-string">"report"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"filter"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"a"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"$lte"</span> <!-- -->: <span class="lg-highlight-number">500</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"lsid"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"id"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-function">UUID</span>(<span class="lg-highlight-string">"5ccd5b81-b023-41f3-8959-bf99ed696ce9"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$db"</span> <!-- -->: <span class="lg-highlight-string">"test"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"cursorid"</span> <!-- -->: <span class="lg-highlight-number">33629063128</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keysExamined"</span> <!-- -->: <span class="lg-highlight-number">101</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"docsExamined"</span> <!-- -->: <span class="lg-highlight-number">101</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"fromMultiPlanner"</span> <!-- -->: <span class="lg-highlight-literal">true</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"numYield"</span> <!-- -->: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"nreturned"</span> <!-- -->: <span class="lg-highlight-number">101</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"planCacheShapeHash"</span> <!-- -->: <span class="lg-highlight-string">"811451DD"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"planCacheKey"</span> <!-- -->: <span class="lg-highlight-string">"759981BA"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"queryFramework"</span> <!-- -->: <span class="lg-highlight-string">"classic"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"locks"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"Global"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"acquireCount"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"r"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">3</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"w"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">3</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"Database"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"acquireCount"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"r"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">3</span>) }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"acquireWaitCount"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"r"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">1</span>) }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"timeAcquiringMicros"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"r"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">69130694</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"Collection"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"acquireCount"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"r"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">3</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"storage"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"data"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"bytesRead"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">14736</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"timeReadingMicros"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">17</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"responseLength"</span> <!-- -->: <span class="lg-highlight-number">1305014</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"protocol"</span> <!-- -->: <span class="lg-highlight-string">"op_msg"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"millis"</span> <!-- -->: <span class="lg-highlight-number">69132</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"planningTimeMicros"</span> <!-- -->: <span class="lg-highlight-number">129</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"planSummary"</span> <!-- -->: <span class="lg-highlight-string">"IXSCAN { a: 1, _id: -1 }"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"execStats"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"stage"</span> <!-- -->: <span class="lg-highlight-string">"FETCH"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"nReturned"</span> <!-- -->: <span class="lg-highlight-number">101</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"executionTimeMillisEstimate"</span> <!-- -->: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"works"</span> <!-- -->: <span class="lg-highlight-number">101</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"advanced"</span> <!-- -->: <span class="lg-highlight-number">101</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"needTime"</span> <!-- -->: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"needYield"</span> <!-- -->: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"saveState"</span> <!-- -->: <span class="lg-highlight-number">3</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"restoreState"</span> <!-- -->: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"isEOF"</span> <!-- -->: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"docsExamined"</span> <!-- -->: <span class="lg-highlight-number">101</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"alreadyHasObj"</span> <!-- -->: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"inputStage"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ts"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-14T16:57:33.450Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"client"</span> <!-- -->: <span class="lg-highlight-string">"127.0.0.1"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"appName"</span> <!-- -->: <span class="lg-highlight-string">"MongoDB Shell"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"allUsers"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"user"</span> <!-- -->: <span class="lg-highlight-string">"someuser"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"db"</span> <!-- -->: <span class="lg-highlight-string">"admin"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"user"</span> <!-- -->: <span class="lg-highlight-string">"someuser@admin"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_hzng7k7r1" class="leafygreen-ui-38lglc" id="_yk0tt266g" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile"> <code class="leafygreen-ui-1l06pbn"> system.profile </code> </a> collection includes metrics for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getMore/#mongodb-dbcommand-dbcmd.getMore"> <code class="leafygreen-ui-1l06pbn"> getMore </code> </a> operation. In this example, <code class="leafygreen-ui-1l06pbn"> getMore </code> returns additional documents from the <code class="leafygreen-ui-1l06pbn"> test.report </code> collection. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"op\" : \"getmore\",\n \"ns\" : \"test.report\",\n \"command\" : {\n \"getMore\" : Long(\"33629063128\"),\n \"collection\" : \"report\",\n \"batchSize\": 3,\n \"lsid\" : {\n \"id\": new UUID(\"3148c569-425c-4498-9168-5b7ee260bf27\")\n },\n \"$db\" : \"test\"\n },\n originatingCommand: {\n \"find: \"report\",\n \"filter\" : { \"a\" : { \"$lte\" : 500 } },\n \"lsid\" : {\n \"id\" : UUID(\"5ccd5b81-b023-41f3-8959-bf99ed696ce9\")\n },\n \"$db\" : \"test\"\n },\n \"cursorid\" : Long(\"33629063128\"),\n \"keysExamined\" : 101,\n \"docsExamined\" : 101,\n \"fromMultiPlanner\" : true,\n \"numYield\" : 2,\n \"nreturned\" : 3,\n \"planCacheShapeHash\" : \"811451DD\",\n \"planCacheKey\" : \"759981BA\",\n \"queryFramework\": \"classic\"\n \"locks\" : {\n \"Global\" : {\n \"acquireCount\" : {\n \"r\" : NumberLong(3),\n \"w\" : NumberLong(3)\n }\n },\n \"Database\" : {\n \"acquireCount\" : { \"r\" : NumberLong(3) },\n \"acquireWaitCount\" : { \"r\" : NumberLong(1) },\n \"timeAcquiringMicros\" : { \"r\" : NumberLong(69130694) }\n },\n \"Collection\" : {\n \"acquireCount\" : { \"r\" : NumberLong(3) }\n }\n },\n readConcern: {level: 'local', provenance: 'implicitDefault'},\n \"responseLength\" : 1305014,\n \"protocol\" : \"op_msg\",\n \"millis\" : 69132,\n \"planSummary\" : \"IXSCAN { a: 1, _id: -1 }\",\n \"execStats\" : {\n \"stage\" : \"FETCH\",\n \"filter\" : { \"a\" : { \"$lte\" : 500 } },\n \"nReturned\" : 101,\n \"executionTimeMillisEstimate\" : 0,\n \"works\" : 104,\n \"advanced\" : 104,\n \"needTime\" : 0,\n \"needYield\" : 0,\n \"saveState\" : 3,\n \"restoreState\" : 2,\n \"isEOF\" : 0,\n \"direction\": 'forward',\n \"docsExamined\" : 104\n },\n \"ts\" : ISODate(\"2019-01-14T16:57:33.450Z\"),\n \"client\" : \"127.0.0.1\",\n \"appName\" : \"MongoDB Shell\",\n \"allUsers\" : [\n {\n \"user\" : \"someuser\",\n \"db\" : \"admin\"\n }\n ],\n \"user\" : \"someuser@admin\"\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"op"</span> <!-- -->: <span class="lg-highlight-string">"getmore"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ns"</span> <!-- -->: <span class="lg-highlight-string">"test.report"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"command"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"getMore"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">Long</span>(<span class="lg-highlight-string">"33629063128"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"collection"</span> <!-- -->: <span class="lg-highlight-string">"report"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"batchSize"</span>: <span class="lg-highlight-number">3</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"lsid"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"id"</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-function">UUID</span>(<span class="lg-highlight-string">"3148c569-425c-4498-9168-5b7ee260bf27"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$db"</span> <!-- -->: <span class="lg-highlight-string">"test"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">originatingCommand</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"find: "</span>report<span class="lg-highlight-string">",</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>filter<span class="lg-highlight-string">" : { "</span>a<span class="lg-highlight-string">" : { "</span>$lte<span class="lg-highlight-string">" : 500 } },</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>lsid<span class="lg-highlight-string">" : {</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>id<span class="lg-highlight-string">" : UUID("</span>5ccd5b81<!-- -->-<!-- -->b023<!-- -->-<!-- -->41f3<!-- -->-<span class="lg-highlight-number">8959</span>-<!-- -->bf99ed696ce9<span class="lg-highlight-string">")</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> },</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>$db<span class="lg-highlight-string">" : "</span>test<span class="lg-highlight-string">"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> },</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>cursorid<span class="lg-highlight-string">" : Long("</span><span class="lg-highlight-number">33629063128</span><span class="lg-highlight-string">"),</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>keysExamined<span class="lg-highlight-string">" : 101,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>docsExamined<span class="lg-highlight-string">" : 101,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>fromMultiPlanner<span class="lg-highlight-string">" : true,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>numYield<span class="lg-highlight-string">" : 2,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>nreturned<span class="lg-highlight-string">" : 3,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>planCacheShapeHash<span class="lg-highlight-string">" : "</span>811451DD<span class="lg-highlight-string">",</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>planCacheKey<span class="lg-highlight-string">" : "</span>759981BA<span class="lg-highlight-string">",</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>queryFramework<span class="lg-highlight-string">": "</span>classic<span class="lg-highlight-string">"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>locks<span class="lg-highlight-string">" : {</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span><span class="lg-highlight-title lg-highlight-class">Global</span><span class="lg-highlight-string">" : {</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>acquireCount<span class="lg-highlight-string">" : {</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>r<span class="lg-highlight-string">" : NumberLong(3),</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>w<span class="lg-highlight-string">" : NumberLong(3)</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> }</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> },</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span><span class="lg-highlight-title lg-highlight-class">Database</span><span class="lg-highlight-string">" : {</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>acquireCount<span class="lg-highlight-string">" : { "</span>r<span class="lg-highlight-string">" : NumberLong(3) },</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>acquireWaitCount<span class="lg-highlight-string">" : { "</span>r<span class="lg-highlight-string">" : NumberLong(1) },</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>timeAcquiringMicros<span class="lg-highlight-string">" : { "</span>r<span class="lg-highlight-string">" : NumberLong(69130694) }</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> },</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span><span class="lg-highlight-title lg-highlight-class">Collection</span><span class="lg-highlight-string">" : {</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>acquireCount<span class="lg-highlight-string">" : { "</span>r<span class="lg-highlight-string">" : NumberLong(3) }</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> }</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> },</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> readConcern: {level: 'local', provenance: 'implicitDefault'},</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>responseLength<span class="lg-highlight-string">" : 1305014,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>protocol<span class="lg-highlight-string">" : "</span>op_msg<span class="lg-highlight-string">",</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>millis<span class="lg-highlight-string">" : 69132,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>planSummary<span class="lg-highlight-string">" : "</span><span class="lg-highlight-variable lg-highlight-constant">IXSCAN</span> <!-- -->{ <span class="lg-highlight-attr">a</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">_id</span>: <!-- -->-<span class="lg-highlight-number">1</span> }<span class="lg-highlight-string">",</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>execStats<span class="lg-highlight-string">" : {</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>stage<span class="lg-highlight-string">" : "</span><span class="lg-highlight-variable lg-highlight-constant">FETCH</span><span class="lg-highlight-string">",</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>filter<span class="lg-highlight-string">" : { "</span>a<span class="lg-highlight-string">" : { "</span>$lte<span class="lg-highlight-string">" : 500 } },</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>nReturned<span class="lg-highlight-string">" : 101,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>executionTimeMillisEstimate<span class="lg-highlight-string">" : 0,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>works<span class="lg-highlight-string">" : 104,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>advanced<span class="lg-highlight-string">" : 104,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>needTime<span class="lg-highlight-string">" : 0,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>needYield<span class="lg-highlight-string">" : 0,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>saveState<span class="lg-highlight-string">" : 3,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>restoreState<span class="lg-highlight-string">" : 2,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>isEOF<span class="lg-highlight-string">" : 0,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>direction<span class="lg-highlight-string">": 'forward',</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>docsExamined<span class="lg-highlight-string">" : 104</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> },</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>ts<span class="lg-highlight-string">" : ISODate("</span><span class="lg-highlight-number">2019</span>-<span class="lg-highlight-number">01</span>-<!-- -->14<span class="lg-highlight-attr">T16</span>:<span class="lg-highlight-number">57</span>:<span class="lg-highlight-number">33.</span>450Z<span class="lg-highlight-string">"),</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>client<span class="lg-highlight-string">" : "</span><span class="lg-highlight-number">127.0</span><span class="lg-highlight-number">.0</span><span class="lg-highlight-number">.1</span><span class="lg-highlight-string">",</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>appName<span class="lg-highlight-string">" : "</span><span class="lg-highlight-title lg-highlight-class">MongoDB</span> <span class="lg-highlight-title lg-highlight-class">Shell</span><span class="lg-highlight-string">",</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>allUsers<span class="lg-highlight-string">" : [</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> {</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>user<span class="lg-highlight-string">" : "</span>someuser<span class="lg-highlight-string">",</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>db<span class="lg-highlight-string">" : "</span>admin<span class="lg-highlight-string">"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> }</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> ],</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> "</span>user<span class="lg-highlight-string">" : "</span>someuser@admin<span class="lg-highlight-string">"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string">}</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"> Starting in MongoDB 8.0, the pre-existing <code class="leafygreen-ui-1l06pbn"> queryHash </code> field is renamed to <code class="leafygreen-ui-1l06pbn"> planCacheShapeHash </code> . If you're using an earlier MongoDB version, you'll see <code class="leafygreen-ui-1l06pbn"> queryHash </code> instead of <code class="leafygreen-ui-1l06pbn"> planCacheShapeHash </code> . </p> </div> </div> </div> <div> <div aria-labelledby="_fd41485ph" class="leafygreen-ui-38lglc" id="_loys6ynms" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The profile entry for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/update/#mongodb-dbcommand-dbcmd.update"> <code class="leafygreen-ui-1l06pbn"> update </code> </a> (and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/delete/#mongodb-dbcommand-dbcmd.delete"> <code class="leafygreen-ui-1l06pbn"> delete </code> </a> ) operation contains the entire update command. </p> <p class="leafygreen-ui-1kp3ins"> The following document in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile"> <code class="leafygreen-ui-1l06pbn"> system.profile </code> </a> collection shows metrics for a sample update operation on the <code class="leafygreen-ui-1l06pbn"> test.report </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"op\" : \"update\",\n \"ns\" : \"test.report\",\n \"command\" : {\n \"q\" : { },\n \"u\" : { \"$rename\" : { \"a\" : \"b\" } },\n \"multi\" : true,\n \"upsert\" : false\n },\n \"keysExamined\" : 0,\n \"docsExamined\" : 25000,\n \"nMatched\" : 25000,\n \"nModified\" : 25000,\n \"keysInserted\" : 25000,\n \"keysDeleted\" : 25000000,\n \"numYield\" : 6985,\n \"locks\" : {\n \"Global\" : {\n \"acquireCount\" : { \"r\" : NumberLong(6986), \"w\" : NumberLong(13972) }\n },\n \"Database\" : {\n \"acquireCount\" : { \"w\" : NumberLong(6986) },\n \"acquireWaitCount\" : { \"w\" : NumberLong(1) },\n \"timeAcquiringMicros\" : { \"w\" : NumberLong(60899375) }\n },\n \"Collection\" : {\n \"acquireCount\" : { \"w\" : NumberLong(6986) }\n },\n \"Mutex\" : {\n \"acquireCount\" : { \"r\" : NumberLong(25000) }\n }\n },\n \"storage\" : {\n \"data\" : {\n \"bytesRead\" : NumberLong(126344060),\n \"bytesWritten\" : NumberLong(281834762),\n \"timeReadingMicros\" : NumberLong(94549),\n \"timeWritingMicros\" : NumberLong(139361)\n }\n },\n \"millis\" : 164687,\n \"planningTimeMicros\" : 129,\n \"planSummary\" : \"COLLSCAN\",\n \"execStats\" : {\n \"stage\" : \"UPDATE\",\n \"nReturned\" : 0,\n \"executionTimeMillisEstimate\" : 103771,\n \"works\" : 25003,\n \"advanced\" : 0,\n \"needTime\" : 25002,\n \"needYield\" : 0,\n \"saveState\" : 6985,\n \"restoreState\" : 6985,\n \"isEOF\" : 1,\n \"nMatched\" : 25000,\n \"nWouldModify\" : 25000,\n \"wouldInsert\" : false,\n \"inputStage\" : {\n \"stage\" : \"COLLSCAN\",\n \"nReturned\" : 25000,\n \"executionTimeMillisEstimate\" : 0,\n \"works\" : 25002,\n \"advanced\" : 25000,\n \"needTime\" : 1,\n \"needYield\" : 0,\n \"saveState\" : 31985,\n \"restoreState\" : 31985,\n \"isEOF\" : 1,\n \"direction\" : \"forward\",\n \"docsExamined\" : 25000\n }\n },\n \"ts\" : ISODate(\"2019-01-14T23:33:01.806Z\"),\n \"client\" : \"127.0.0.1\",\n \"appName\" : \"MongoDB Shell\",\n \"allUsers\" : [\n {\n \"user\" : \"someuser\",\n \"db\" : \"admin\"\n }\n ],\n \"user\" : \"someuser@admin\"\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"op"</span> <!-- -->: <span class="lg-highlight-string">"update"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ns"</span> <!-- -->: <span class="lg-highlight-string">"test.report"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"command"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"q"</span> <!-- -->: <!-- -->{ <!-- -->}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"u"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"$rename"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"a"</span> <!-- -->: <span class="lg-highlight-string">"b"</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"multi"</span> <!-- -->: <span class="lg-highlight-literal">true</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"upsert"</span> <!-- -->: <span class="lg-highlight-literal">false</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keysExamined"</span> <!-- -->: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"docsExamined"</span> <!-- -->: <span class="lg-highlight-number">25000</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"nMatched"</span> <!-- -->: <span class="lg-highlight-number">25000</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"nModified"</span> <!-- -->: <span class="lg-highlight-number">25000</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keysInserted"</span> <!-- -->: <span class="lg-highlight-number">25000</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keysDeleted"</span> <!-- -->: <span class="lg-highlight-number">25000000</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"numYield"</span> <!-- -->: <span class="lg-highlight-number">6985</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"locks"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"Global"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"acquireCount"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"r"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">6986</span>)<!-- -->, <span class="lg-highlight-string">"w"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">13972</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"Database"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"acquireCount"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"w"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">6986</span>) }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"acquireWaitCount"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"w"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">1</span>) }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"timeAcquiringMicros"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"w"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">60899375</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"Collection"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"acquireCount"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"w"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">6986</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"Mutex"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"acquireCount"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"r"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">25000</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"storage"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"data"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"bytesRead"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">126344060</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"bytesWritten"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">281834762</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"timeReadingMicros"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">94549</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"timeWritingMicros"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">139361</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"millis"</span> <!-- -->: <span class="lg-highlight-number">164687</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"planningTimeMicros"</span> <!-- -->: <span class="lg-highlight-number">129</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"planSummary"</span> <!-- -->: <span class="lg-highlight-string">"COLLSCAN"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"execStats"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"stage"</span> <!-- -->: <span class="lg-highlight-string">"UPDATE"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"nReturned"</span> <!-- -->: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"executionTimeMillisEstimate"</span> <!-- -->: <span class="lg-highlight-number">103771</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"works"</span> <!-- -->: <span class="lg-highlight-number">25003</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"advanced"</span> <!-- -->: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"needTime"</span> <!-- -->: <span class="lg-highlight-number">25002</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"needYield"</span> <!-- -->: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"saveState"</span> <!-- -->: <span class="lg-highlight-number">6985</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"restoreState"</span> <!-- -->: <span class="lg-highlight-number">6985</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"isEOF"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"nMatched"</span> <!-- -->: <span class="lg-highlight-number">25000</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"nWouldModify"</span> <!-- -->: <span class="lg-highlight-number">25000</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"wouldInsert"</span> <!-- -->: <span class="lg-highlight-literal">false</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"inputStage"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"stage"</span> <!-- -->: <span class="lg-highlight-string">"COLLSCAN"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"nReturned"</span> <!-- -->: <span class="lg-highlight-number">25000</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"executionTimeMillisEstimate"</span> <!-- -->: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"works"</span> <!-- -->: <span class="lg-highlight-number">25002</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"advanced"</span> <!-- -->: <span class="lg-highlight-number">25000</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"needTime"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"needYield"</span> <!-- -->: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"saveState"</span> <!-- -->: <span class="lg-highlight-number">31985</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"restoreState"</span> <!-- -->: <span class="lg-highlight-number">31985</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"isEOF"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"direction"</span> <!-- -->: <span class="lg-highlight-string">"forward"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"docsExamined"</span> <!-- -->: <span class="lg-highlight-number">25000</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ts"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-14T23:33:01.806Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"client"</span> <!-- -->: <span class="lg-highlight-string">"127.0.0.1"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"appName"</span> <!-- -->: <span class="lg-highlight-string">"MongoDB Shell"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"allUsers"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"user"</span> <!-- -->: <span class="lg-highlight-string">"someuser"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"db"</span> <!-- -->: <span class="lg-highlight-string">"admin"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"user"</span> <!-- -->: <span class="lg-highlight-string">"someuser@admin"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/faq/diagnostics/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> FAQ: Self-Managed MongoDB Diagnostics <a class="headerlink leafygreen-ui-1kepx47" href="#faq--self-managed-mongodb-diagnostics" 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="faq--self-managed-mongodb-diagnostics"> </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="#where-can-i-find-information-about-a-mongod-process-that-stopped-running-unexpectedly-" target="_self"> <span> Where can I find information about a <code class="css-1kekw28 e1wawog0"> mongod </code> process that stopped running unexpectedly? </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#does-tcp-keepalive-time-affect-mongodb-deployments-" target="_self"> <span> Does TCP <code class="css-1kekw28 e1wawog0"> keepalive </code> time affect MongoDB Deployments? </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#do-tcp-retransmission-timeouts-affect-mongodb-deployments-" target="_self"> <span> Do TCP Retransmission Timeouts affect MongoDB Deployments? </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#why-does-mongodb-log-so-many--connection-accepted--events-" target="_self"> <span> Why does MongoDB log so many "Connection Accepted" events? </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#what-tools-are-available-for-monitoring-mongodb-" target="_self"> <span> What tools are available for monitoring MongoDB? </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#memory-diagnostics-for-the-wiredtiger-storage-engine" target="_self"> <span> Memory Diagnostics for the WiredTiger Storage Engine </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#sharded-cluster-diagnostics" target="_self"> <span> Sharded Cluster Diagnostics </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> This document provides answers to common diagnostic questions and issues. </p> <p class="leafygreen-ui-1kp3ins"> If you don't find the answer you're looking for, check the <a class="leafygreen-ui-tqgtui" href="/docs/manual/faq/#std-label-faq-manual"> complete list of FAQs </a> or post your question to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://community.mongodb.com/?tck=docs_server" target="_self"> <span> MongoDB Community </span> </a> . </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Where can I find information about a <code class="leafygreen-ui-1l06pbn"> mongod </code> process that stopped running unexpectedly? <a class="headerlink leafygreen-ui-1kepx47" href="#where-can-i-find-information-about-a-mongod-process-that-stopped-running-unexpectedly-" 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="where-can-i-find-information-about-a-mongod-process-that-stopped-running-unexpectedly-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> shuts down unexpectedly on a UNIX or UNIX-based platform, and if <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> fails to log a shutdown or error message, then check your system logs for messages pertaining to MongoDB. For example, for logs located in <code class="leafygreen-ui-1l06pbn"> /var/log/messages </code> , use the following commands: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo grep mongod /var/log/messages\nsudo grep score /var/log/messages","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">sudo grep mongod <!-- -->/var/log/messages</td></tr><tr class=""><td class="leafygreen-ui-7razhx">sudo grep score <!-- -->/var/log/messages</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> <span class="leafygreen-ui-1qnjd6d" id="std-label-faq-keepalive"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Does TCP <code class="leafygreen-ui-1l06pbn"> keepalive </code> time affect MongoDB Deployments? <a class="headerlink leafygreen-ui-1kepx47" href="#does-tcp-keepalive-time-affect-mongodb-deployments-" 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="does-tcp-keepalive-time-affect-mongodb-deployments-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If you experience network timeouts or socket errors in communication between clients and servers, or between members of a sharded cluster or replica set, check the <em> TCP keepalive value </em> for the affected systems. </p> <p class="leafygreen-ui-1kp3ins"> Many operating systems set this value to <code class="leafygreen-ui-1l06pbn"> 7200 </code> seconds (two hours) by default. For MongoDB, you will generally experience better results with a shorter keepalive value, on the order of <code class="leafygreen-ui-1l06pbn"> 120 </code> seconds (two minutes). </p> <p class="leafygreen-ui-1kp3ins"> If your MongoDB deployment experiences keepalive-related issues, you must alter the keepalive value on <em> all </em> affected systems. This includes all machines running <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> processes and all machines hosting client processes that connect to MongoDB. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Adjusting the TCP keepalive value: <a class="headerlink leafygreen-ui-1kepx47" href="#adjusting-the-tcp-keepalive-value-" 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="adjusting-the-tcp-keepalive-value-"> </div> </a> </h3> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-7"> <div aria-label="Tabs to describe usage of linux-keepalive/macos-keepalive/windows-keepalive" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_bsqrycisw" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_brx8ov5wd" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Linux </div> </button> <button aria-controls="_52na03rgk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_hlx227e28" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Windows </div> </button> <button aria-controls="_1yeqtcc3a" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_cbgubo2cy" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> macOS </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_fzktmp1vp" class="" id="_mzsxj4ilg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To view the keepalive setting on Linux, use one of the following commands: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sysctl net.ipv4.tcp_keepalive_time","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">sysctl net.ipv4.tcp_keepalive_time</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"> Or: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cat /proc/sys/net/ipv4/tcp_keepalive_time","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"><span class="lg-highlight-built_in">cat</span> <!-- -->/proc/sys/net/ipv<!-- -->4<!-- -->/tcp_keepalive_time</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 value is measured in seconds. </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"> Although the setting name includes <code class="leafygreen-ui-1l06pbn"> ipv4 </code> , the <code class="leafygreen-ui-1l06pbn"> tcp_keepalive_time </code> value applies to both IPv4 and IPv6. </p> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To change the <code class="leafygreen-ui-1l06pbn"> tcp_keepalive_time </code> value, you can use one of the following commands, supplying a <em> &lt;value&gt; </em> in seconds: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo sysctl -w net.ipv4.tcp_keepalive_time=&lt;value&gt;","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">sudo sysctl -w net.ipv4.tcp_keepalive_time=&lt;value&gt;</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"> Or: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"echo &lt;value&gt; | sudo tee /proc/sys/net/ipv4/tcp_keepalive_time","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"><span class="lg-highlight-built_in">echo</span> &lt;value&gt; | sudo <span class="lg-highlight-built_in">tee</span> <!-- -->/proc/sys/net/ipv<!-- -->4<!-- -->/tcp_keepalive_time</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"> These operations do not persist across system reboots. To persist the setting, add the following line to <code class="leafygreen-ui-1l06pbn"> /etc/sysctl.conf </code> , supplying a <em> &lt;value&gt; </em> in seconds, and reboot the machine: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"net.ipv4.tcp_keepalive_time = &lt;value&gt;","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">net.ipv4.tcp_keepalive_time = &lt;value&gt;</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"> Keepalive values greater than <code class="leafygreen-ui-1l06pbn"> 300 </code> seconds, (5 minutes) will be overridden on <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> sockets and set to <code class="leafygreen-ui-1l06pbn"> 300 </code> seconds. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_99ezy1nph" class="leafygreen-ui-38lglc" id="_s3jw1zxdv" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To view the keepalive setting on Windows, issue the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"reg query HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters /v KeepAliveTime"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">reg query HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v KeepAliveTime</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 registry value is not present by default. The system default, used if the value is absent, is <code class="leafygreen-ui-1l06pbn"> 7200000 </code> milliseconds or <code class="leafygreen-ui-1l06pbn"> 0x6ddd00 </code> in hexadecimal. </p> <div class="line-block"> <div class="line"> <br/> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To change the <code class="leafygreen-ui-1l06pbn"> KeepAliveTime </code> value, use the following command in an Administrator <span class="guilabel css-h15tq0"> Command Prompt </span> , where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is expressed in hexadecimal (e.g. <code class="leafygreen-ui-1l06pbn"> 120000 </code> is <code class="leafygreen-ui-1l06pbn"> 0x1d4c0 </code> ): </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"reg add HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\ /t REG_DWORD /v KeepAliveTime /d &lt;value&gt;"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ /t REG_DWORD /v KeepAliveTime /d &lt;value&gt;</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"> Windows users should consider the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://technet.microsoft.com/en-us/library/cc957549.aspx" rel="noopener noreferrer"> <span> Windows Server Technet Article on KeepAliveTime </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> for more information on setting keepalive for MongoDB deployments on Windows systems. Keepalive values greater than or equal to <em> 600000 </em> milliseconds (10 minutes) will be ignored by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> . </a> </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_eyf3ajw27" class="leafygreen-ui-38lglc" id="_l0zye2h8o" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To view the keepalive setting on macOS, issue the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sysctl net.inet.tcp.keepidle","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">sysctl net.inet.tcp.keepidle</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 value is measured in milliseconds. </p> <div class="line-block"> <div class="line"> <br/> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To change the <code class="leafygreen-ui-1l06pbn"> net.inet.tcp.keepidle </code> value, you can use the following command, supplying a <em> &lt;value&gt; </em> in milliseconds: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo sysctl net.inet.tcp.keepidle=&lt;value&gt;","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">sudo sysctl net.inet.tcp.keepidle=&lt;value&gt;</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 operation does not persist across system reboots, and must be set each time your system reboots. See your operating system's documentation for instructions on setting this value persistently. Keepalive values greater than or equal to <code class="leafygreen-ui-1l06pbn"> 600000 </code> milliseconds (10 minutes) will be ignored by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> . </a> </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"> In macOS 10.15 Catalina, Apple no longer allows for configuration of the <code class="leafygreen-ui-1l06pbn"> net.inet.tcp.keepidle </code> option. </p> </div> </div> </li> </ul> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> You will need to restart <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> processes for new system-wide keepalive settings to take effect. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-faq-tcp_retries2"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Do TCP Retransmission Timeouts affect MongoDB Deployments? <a class="headerlink leafygreen-ui-1kepx47" href="#do-tcp-retransmission-timeouts-affect-mongodb-deployments-" 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="do-tcp-retransmission-timeouts-affect-mongodb-deployments-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If you experience long stalls (stalls greater than two minutes) followed by network timeouts or socket errors between clients and server or between members of a sharded cluster or replica set, check the <code class="leafygreen-ui-1l06pbn"> tcp_retries2 </code> value for the affected systems. </p> <p class="leafygreen-ui-1kp3ins"> Most Linux operating systems set this value to <code class="leafygreen-ui-1l06pbn"> 15 </code> by default, while Windows sets it to <code class="leafygreen-ui-1l06pbn"> 5 </code> . For MongoDB, you experience better results with a lower <code class="leafygreen-ui-1l06pbn"> tcp_retries2 </code> value, on the order of <code class="leafygreen-ui-1l06pbn"> 5 </code> (12 seconds) or lower. </p> <p class="leafygreen-ui-1kp3ins"> If your MongoDB deployment experiences TCP retransmission timeout-related issues, change the <code class="leafygreen-ui-1l06pbn"> tcp_retries2 </code> value ( <code class="leafygreen-ui-1l06pbn"> TcpMaxDataRetransmission </code> on Windows) for <em> all </em> affected systems. This includes all machines running <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> processes and all machines hosting client processes that connect to MongoDB. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Adjust the TCP Retransmission Timeout <a class="headerlink leafygreen-ui-1kepx47" href="#adjust-the-tcp-retransmission-timeout" 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="adjust-the-tcp-retransmission-timeout"> </div> </a> </h3> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-10"> <div aria-label="Tabs to describe usage of linux/windows" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_7hxd358mu" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_sc60yq8o5" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Linux </div> </button> <button aria-controls="_oasunjdgz" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_og2bsyjpf" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Windows </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_nlzokf60b" class="" id="_pmbx5txwz" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> On most Linux operating systems, control the TCP retransmission by adjusting the <code class="leafygreen-ui-1l06pbn"> net.ipv4.tcp_retries2 </code> sysctl setting. </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"> Although the setting name includes <code class="leafygreen-ui-1l06pbn"> ipv4 </code> , the <code class="leafygreen-ui-1l06pbn"> tcp_retries2 </code> setting applies to both IPv4 and IPv6. </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To view the current setting, use the <code class="leafygreen-ui-1l06pbn"> sysctl </code> command: </p> <div class="css-1f5771r"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sysctl net.ipv4.tcp_retries2","programmingLanguage":"Bash"} </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 bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sysctl net.ipv4.tcp_retries2</td></tr></tbody></table></code></pre> </div> </div> </div> <div class="css-9st569 efa38qy0" style="--border-color:#E8EDEB"> <button aria-disabled="false" class="lg-ui-button-0000 leafygreen-ui-hix6y6" data-lgid="lg-button" role="button" type="button"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg alt="" aria-hidden="true" class="leafygreen-ui-hjnzs9" fill="none" height="16" role="presentation" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M14.364 10.778a1 1 0 0 0 0-1.414l-4.95-4.95-.707-.707a1 1 0 0 0-1.414 0l-.707.707-4.95 4.95a1 1 0 0 0 0 1.414l.707.707a1 1 0 0 0 1.414 0L8 7.243l4.243 4.242a1 1 0 0 0 1.414 0l.707-.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> HIDE OUTPUT </div> </button> </div> <div class="leafygreen-ui-1oteowz"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"net.ipv4.tcp_retries = 15","programmingLanguage":"Bash"} </script> <div class="css-1sax7hu e11q6jfk0" style="--code-container-border:initial;--code-pre-border:none"> <div class="leafygreen-ui-1fyvhqe"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1qhgg7e" tabindex="-1"><code class="lg-highlight-hljs-dark bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">net.ipv4.tcp_retries = 15</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To change the <code class="leafygreen-ui-1l06pbn"> tcp_retries2 </code> setting at runtime, use the <code class="leafygreen-ui-1l06pbn"> sysctl </code> command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sysctl -w net.ipv4.tcp_retries2=8","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">sysctl -w net.ipv4.tcp_retries2=8</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To make the change permanent, edit the configuration file: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Open <code class="leafygreen-ui-1l06pbn"> /etc/sysctl.conf </code> in your preferred text editor: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"vi /etc/sysctl.conf","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">vi <!-- -->/etc/sysctl.conf</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Configure the <code class="leafygreen-ui-1l06pbn"> net.ipv4.tcp_retries2 </code> setting: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"net.ipv4.tcp_retries2 = 8"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">net.ipv4.tcp_retries2 = 8</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Restart the system. </p> </li> </ol> <p class="leafygreen-ui-1kp3ins"> Your system now uses the new <code class="leafygreen-ui-1l06pbn"> tcp_retries2 </code> setting. </p> </li> </ul> </div> </div> </div> <div> <div aria-labelledby="_6xbicx7r3" class="leafygreen-ui-38lglc" id="_zircdohkd" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> On Windows, control TCP Retransmission by adjusting the <code class="leafygreen-ui-1l06pbn"> TcpMaxDataRetransmissions </code> parameter. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To view the <code class="leafygreen-ui-1l06pbn"> TcpMaxDataRetransmissions </code> setting on Windows, issue the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"reg query HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters /v TcpMaxDataRetransmissions"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">reg query HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v TcpMaxDataRetransmissions</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"> By default, the parameter is not set. The system default, used if the value is absent, is <code class="leafygreen-ui-1l06pbn"> 5 </code> retries. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To change the <code class="leafygreen-ui-1l06pbn"> TcpMaxDataRetransmissions </code> value, use the following command in an Administrator <span class="guilabel css-h15tq0"> Command Prompt </span> , where <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> is an integer: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"reg add HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\ /t REG_DWORD /v TcpMaxDataRetransmission /d &lt;value&gt;"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ /t REG_DWORD /v TcpMaxDataRetransmission /d &lt;value&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ul> </div> </div> </div> </div> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Why does MongoDB log so many "Connection Accepted" events? <a class="headerlink leafygreen-ui-1kepx47" href="#why-does-mongodb-log-so-many--connection-accepted--events-" 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="why-does-mongodb-log-so-many--connection-accepted--events-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If you see a very large number of connection and re-connection messages in your MongoDB log, then clients are frequently connecting and disconnecting to the MongoDB server. This is normal behavior for applications that do not use request pooling, such as CGI. Consider using FastCGI, an Apache Module, or some other kind of persistent application server to decrease the connection overhead. </p> <p class="leafygreen-ui-1kp3ins"> If these connections do not impact your performance you can use the run-time <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.quiet"> <code class="leafygreen-ui-1l06pbn"> quiet </code> </a> option or the command-line option <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--quiet"> <code class="leafygreen-ui-1l06pbn"> --quiet </code> </a> to suppress these messages from the log. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> What tools are available for monitoring MongoDB? <a class="headerlink leafygreen-ui-1kepx47" href="#what-tools-are-available-for-monitoring-mongodb-" 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="what-tools-are-available-for-monitoring-mongodb-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://cloud.mongodb.com/?tck=docs_server" target="_self"> <span> MongoDB Cloud Manager </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/products/mongodb-enterprise-advanced?tck=docs_server" target="_self"> <span> Ops Manager, an on-premise solution available in MongoDB Enterprise Advanced </span> </a> include monitoring functionality, which collects data from running MongoDB deployments and provides visualization and alerts based on that data. </p> <p class="leafygreen-ui-1kp3ins"> For more information, see also the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/cloud-manager/" target="_self"> <span> MongoDB Cloud Manager documentation </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/ops-manager/current/application/" target="_self"> <span> Ops Manager documentation <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> A full list of third-party tools is available as part of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/monitoring/"> Monitoring a Self-Managed MongoDB Deployment </a> documentation. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-faq-memory-wt"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Memory Diagnostics for the WiredTiger Storage Engine <a class="headerlink leafygreen-ui-1kepx47" href="#memory-diagnostics-for-the-wiredtiger-storage-engine" 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="memory-diagnostics-for-the-wiredtiger-storage-engine"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Must my working set size fit RAM? <a class="headerlink leafygreen-ui-1kepx47" href="#must-my-working-set-size-fit-ram-" 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="must-my-working-set-size-fit-ram-"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> No. </p> <p class="leafygreen-ui-1kp3ins"> If the cache does not have enough space to load additional data, WiredTiger evicts pages from the cache to free up space. </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"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.wiredTiger.engineConfig.cacheSizeGB"> <code class="leafygreen-ui-1l06pbn"> storage.wiredTiger.engineConfig.cacheSizeGB </code> </a> limits the size of the WiredTiger internal cache. The operating system uses the available free memory for filesystem cache, which allows the compressed MongoDB data files to stay in memory. In addition, the operating system uses any free RAM to buffer file system blocks and file system cache. </p> <p class="leafygreen-ui-1kp3ins"> To accommodate the additional consumers of RAM, you may have to decrease WiredTiger internal cache size. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The default WiredTiger internal cache size value assumes that there is a single <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance per machine. If a single machine contains multiple MongoDB instances, then you should decrease the setting to accommodate the other <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances. </p> <p class="leafygreen-ui-1kp3ins"> If you run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> in a container (for example, <code class="leafygreen-ui-1l06pbn"> lxc </code> , <code class="leafygreen-ui-1l06pbn"> cgroups </code> , Docker, etc.) that does <em> not </em> have access to all of the RAM available in a system, you must set <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.wiredTiger.engineConfig.cacheSizeGB"> <code class="leafygreen-ui-1l06pbn"> storage.wiredTiger.engineConfig.cacheSizeGB </code> </a> to a value less than the amount of RAM available in the container. The exact amount depends on the other processes running in the container. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hostInfo/#mongodb-data-hostInfo.system.memLimitMB"> <code class="leafygreen-ui-1l06pbn"> memLimitMB </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To see statistics on the cache and eviction, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-dbcommand-dbcmd.serverStatus"> <code class="leafygreen-ui-1l06pbn"> serverStatus </code> </a> command. The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.wiredTiger.cache"> <code class="leafygreen-ui-1l06pbn"> wiredTiger.cache </code> </a> field holds the information on the cache and eviction. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"...\n\"wiredTiger\" : {\n ...\n \"cache\" : {\n \"tracked dirty bytes in the cache\" : &lt;num&gt;,\n \"bytes currently in the cache\" : &lt;num&gt;,\n \"maximum bytes configured\" : &lt;num&gt;,\n \"bytes read into cache\" :&lt;num&gt;,\n \"bytes written from cache\" : &lt;num&gt;,\n \"pages evicted by application threads\" : &lt;num&gt;,\n \"checkpoint blocked page eviction\" : &lt;num&gt;,\n \"unmodified pages evicted\" : &lt;num&gt;,\n \"page split during eviction deepened the tree\" : &lt;num&gt;,\n \"modified pages evicted\" : &lt;num&gt;,\n \"pages selected for eviction unable to be evicted\" : &lt;num&gt;,\n \"pages evicted because they exceeded the in-memory maximum\" : &lt;num&gt;,,\n \"pages evicted because they had chains of deleted items\" : &lt;num&gt;,\n \"failed eviction of pages that exceeded the in-memory maximum\" : &lt;num&gt;,\n \"hazard pointer blocked page eviction\" : &lt;num&gt;,\n \"internal pages evicted\" : &lt;num&gt;,\n \"maximum page size at eviction\" : &lt;num&gt;,\n \"eviction server candidate queue empty when topping up\" : &lt;num&gt;,\n \"eviction server candidate queue not empty when topping up\" : &lt;num&gt;,\n \"eviction server evicting pages\" : &lt;num&gt;,\n \"eviction server populating queue, but not evicting pages\" : &lt;num&gt;,\n \"eviction server unable to reach eviction goal\" : &lt;num&gt;,\n \"pages split during eviction\" : &lt;num&gt;,\n \"pages walked for eviction\" : &lt;num&gt;,\n \"eviction worker thread evicting pages\" : &lt;num&gt;,\n \"in-memory page splits\" : &lt;num&gt;,\n \"percentage overhead\" : &lt;num&gt;,\n \"tracked dirty pages in the cache\" : &lt;num&gt;,\n \"pages currently held in the cache\" : &lt;num&gt;,\n \"pages read into cache\" : &lt;num&gt;,\n \"pages written from cache\" : &lt;num&gt;,\n },\n ..."} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">...</td></tr><tr class=""><td class="leafygreen-ui-7razhx">"wiredTiger" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "cache" : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "tracked dirty bytes in the cache" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "bytes currently in the cache" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "maximum bytes configured" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "bytes read into cache" :&lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "bytes written from cache" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "pages evicted by application threads" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "checkpoint blocked page eviction" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "unmodified pages evicted" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "page split during eviction deepened the tree" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "modified pages evicted" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "pages selected for eviction unable to be evicted" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "pages evicted because they exceeded the in-memory maximum" : &lt;num&gt;,,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "pages evicted because they had chains of deleted items" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "failed eviction of pages that exceeded the in-memory maximum" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "hazard pointer blocked page eviction" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "internal pages evicted" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "maximum page size at eviction" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "eviction server candidate queue empty when topping up" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "eviction server candidate queue not empty when topping up" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "eviction server evicting pages" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "eviction server populating queue, but not evicting pages" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "eviction server unable to reach eviction goal" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "pages split during eviction" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "pages walked for eviction" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "eviction worker thread evicting pages" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "in-memory page splits" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "percentage overhead" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "tracked dirty pages in the cache" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "pages currently held in the cache" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "pages read into cache" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "pages written from cache" : &lt;num&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For an explanation of some key cache and eviction statistics, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.wiredTiger.cache.bytes-currently-in-the-cache"> <code class="leafygreen-ui-1l06pbn"> wiredTiger.cache.bytes currently in the cache </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.wiredTiger.cache.tracked-dirty-bytes-in-the-cache"> <code class="leafygreen-ui-1l06pbn"> wiredTiger.cache.tracked dirty bytes in the cache </code> </a> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.wiredTiger.cache"> <code class="leafygreen-ui-1l06pbn"> wiredTiger.cache </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To adjust the size of the WiredTiger internal cache, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.wiredTiger.engineConfig.cacheSizeGB"> <code class="leafygreen-ui-1l06pbn"> storage.wiredTiger.engineConfig.cacheSizeGB </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--wiredTigerCacheSizeGB"> <code class="leafygreen-ui-1l06pbn"> --wiredTigerCacheSizeGB </code> </a> . Avoid increasing the WiredTiger internal cache size above its default value. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> How do I calculate how much RAM I need for my application? <a class="headerlink leafygreen-ui-1kepx47" href="#how-do-i-calculate-how-much-ram-i-need-for-my-application-" 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="how-do-i-calculate-how-much-ram-i-need-for-my-application-"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> With WiredTiger, MongoDB utilizes both the WiredTiger internal cache and the filesystem cache. </p> <p class="leafygreen-ui-1kp3ins"> The default WiredTiger internal cache size is the larger of either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 50% of (RAM - 1 GB), or </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 256 MB. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For example, on a system with a total of 4GB of RAM the WiredTiger cache uses 1.5GB of RAM ( <code class="leafygreen-ui-1l06pbn"> 0.5 * (4 GB - 1 GB) = 1.5 GB </code> ). Conversely, on a system with a total of 1.25 GB of RAM WiredTiger allocates 256 MB to the WiredTiger cache because that is more than half of the total RAM minus one gigabyte ( <code class="leafygreen-ui-1l06pbn"> 0.5 * (1.25 GB - 1 GB) = 128 MB &lt; 256 MB </code> ). </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"> In some instances, such as when running in a container, the database can have memory constraints that are lower than the total system memory. In such instances, this memory limit, rather than the total system memory, is used as the maximum RAM available. </p> <p class="leafygreen-ui-1kp3ins"> To see the memory limit, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hostInfo/#mongodb-data-hostInfo.system.memLimitMB"> <code class="leafygreen-ui-1l06pbn"> hostInfo.system.memLimitMB </code> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> By default, WiredTiger uses Snappy block compression for all collections and prefix compression for all indexes. Compression defaults are configurable at a global level and can also be set on a per-collection and per-index basis during collection and index creation. </p> <p class="leafygreen-ui-1kp3ins"> Different representations are used for data in the WiredTiger internal cache versus the on-disk format: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Data in the filesystem cache is the same as the on-disk format, including benefits of any compression for data files. The filesystem cache is used by the operating system to reduce disk I/O. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Indexes loaded in the WiredTiger internal cache have a different data representation to the on-disk format, but can still take advantage of index prefix compression to reduce RAM usage. Index prefix compression deduplicates common prefixes from indexed fields. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Collection data in the WiredTiger internal cache is uncompressed and uses a different representation from the on-disk format. Block compression can provide significant on-disk storage savings, but data must be uncompressed to be manipulated by the server. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> With the filesystem cache, MongoDB automatically uses all free memory that is not used by the WiredTiger cache or by other processes. </p> <p class="leafygreen-ui-1kp3ins"> To adjust the size of the WiredTiger internal cache, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.wiredTiger.engineConfig.cacheSizeGB"> <code class="leafygreen-ui-1l06pbn"> storage.wiredTiger.engineConfig.cacheSizeGB </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--wiredTigerCacheSizeGB"> <code class="leafygreen-ui-1l06pbn"> --wiredTigerCacheSizeGB </code> </a> . Avoid increasing the WiredTiger internal cache size above its default value. </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"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.wiredTiger.engineConfig.cacheSizeGB"> <code class="leafygreen-ui-1l06pbn"> storage.wiredTiger.engineConfig.cacheSizeGB </code> </a> limits the size of the WiredTiger internal cache. The operating system uses the available free memory for filesystem cache, which allows the compressed MongoDB data files to stay in memory. In addition, the operating system uses any free RAM to buffer file system blocks and file system cache. </p> <p class="leafygreen-ui-1kp3ins"> To accommodate the additional consumers of RAM, you may have to decrease WiredTiger internal cache size. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The default WiredTiger internal cache size value assumes that there is a single <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance per machine. If a single machine contains multiple MongoDB instances, then you should decrease the setting to accommodate the other <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances. </p> <p class="leafygreen-ui-1kp3ins"> If you run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> in a container (for example, <code class="leafygreen-ui-1l06pbn"> lxc </code> , <code class="leafygreen-ui-1l06pbn"> cgroups </code> , Docker, etc.) that does <em> not </em> have access to all of the RAM available in a system, you must set <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.wiredTiger.engineConfig.cacheSizeGB"> <code class="leafygreen-ui-1l06pbn"> storage.wiredTiger.engineConfig.cacheSizeGB </code> </a> to a value less than the amount of RAM available in the container. The exact amount depends on the other processes running in the container. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hostInfo/#mongodb-data-hostInfo.system.memLimitMB"> <code class="leafygreen-ui-1l06pbn"> memLimitMB </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To view statistics on the cache and eviction rate, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.wiredTiger.cache"> <code class="leafygreen-ui-1l06pbn"> wiredTiger.cache </code> </a> field returned from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-dbcommand-dbcmd.serverStatus"> <code class="leafygreen-ui-1l06pbn"> serverStatus </code> </a> command. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Sharded Cluster Diagnostics <a class="headerlink leafygreen-ui-1kepx47" href="#sharded-cluster-diagnostics" 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="sharded-cluster-diagnostics"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The two most important factors in maintaining a successful sharded cluster are: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-shard-key/#std-label-sharding-internals-shard-keys"> choosing an appropriate shard key </a> and </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-requirements/#std-label-sharding-capacity-planning"> sufficient capacity to support current and future operations <!-- --> . </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> While you can <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-change-a-shard-key/#std-label-change-a-shard-key"> change your shard key </a> later, it is important to carefully consider your shard key choice to avoid scalability and performance issues. Continue reading for specific issues you may encounter in a production environment. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-sharding-troubleshooting-not-splitting"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> In a new sharded cluster, why does all data remain on one shard? <a class="headerlink leafygreen-ui-1kepx47" href="#in-a-new-sharded-cluster--why-does-all-data-remain-on-one-shard-" 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="in-a-new-sharded-cluster--why-does-all-data-remain-on-one-shard-"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Your cluster must have sufficient data for sharding to make sense. Sharding works by migrating chunks between the shards until each shard has roughly the same number of chunks. </p> <p class="leafygreen-ui-1kp3ins"> The default chunk size is 128 megabytes. MongoDB will not begin migrations until the imbalance of chunks in the cluster exceeds the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-balancer-administration/#std-label-sharding-migration-thresholds"> migration threshold </a> . This behavior helps prevent unnecessary chunk migrations, which can degrade the performance of your cluster as a whole. </p> <p class="leafygreen-ui-1kp3ins"> If you have just deployed a sharded cluster, make sure that you have enough data to make sharding effective. If you do not have sufficient data to create more than eight 128 megabyte chunks, then all data will remain on one shard. Either lower the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-data-partitioning/#std-label-sharding-chunk-size"> chunk size </a> setting, or add more data to the cluster. </p> <p class="leafygreen-ui-1kp3ins"> As a related problem, the system will split chunks only on inserts or updates, which means that if you configure sharding and do not continue to issue insert and update operations, the database will not create any chunks. You can either wait until your application inserts data <em> or </em> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/split-chunks-in-sharded-cluster/#std-label-split-chunks-sharded-cluster"> split chunks manually <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Finally, if your shard key has a low <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-choose-a-shard-key/#std-label-sharding-shard-key-cardinality"> cardinality </a> , MongoDB may not be able to create sufficient splits among the data. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Why would one shard receive a disproportionate amount of traffic in a sharded cluster? <a class="headerlink leafygreen-ui-1kepx47" href="#why-would-one-shard-receive-a-disproportionate-amount-of-traffic-in-a-sharded-cluster-" 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="why-would-one-shard-receive-a-disproportionate-amount-of-traffic-in-a-sharded-cluster-"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> In some situations, a single shard or a subset of the cluster will receive a disproportionate portion of the traffic and workload. In almost all cases this is the result of a shard key that does not effectively allow <a class="leafygreen-ui-tqgtui" href="/docs/manual/sharding/#std-label-sharding-shard-key-write-scaling"> write scaling <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> It's also possible that you have "hot chunks." In this case, you may be able to solve the problem by splitting and then migrating parts of these chunks. </p> <p class="leafygreen-ui-1kp3ins"> You may have to consider <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-reshard-a-collection/#std-label-sharding-resharding"> resharding your collection </a> with a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-choose-a-shard-key/#std-label-sharding-internals-choose-shard-key"> different shard key </a> to correct this pattern. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> What can prevent a sharded cluster from balancing? <a class="headerlink leafygreen-ui-1kepx47" href="#what-can-prevent-a-sharded-cluster-from-balancing-" 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="what-can-prevent-a-sharded-cluster-from-balancing-"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you have just deployed your sharded cluster, you may want to consider the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-sharding-troubleshooting-not-splitting" target="_self"> <span> troubleshooting suggestions for a new cluster where data remains on a single shard <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> If the cluster was initially balanced, but later developed an uneven distribution of data, consider the following possible causes: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You have deleted or removed a significant amount of data from the cluster. If you have added additional data, it may have a different distribution with regards to its shard key. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key"> shard key </a> has low <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-choose-a-shard-key/#std-label-sharding-shard-key-cardinality"> cardinality </a> and MongoDB cannot split the chunks any further. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your data set is growing faster than the balancer can distribute data around the cluster. This is uncommon and typically is the result of: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> a <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-sharded-cluster-balancer/#std-label-sharding-schedule-balancing-window"> balancing window </a> that is too short, given the rate of data growth. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> an uneven distribution of <a class="leafygreen-ui-tqgtui" href="/docs/manual/sharding/#std-label-sharding-shard-key-write-scaling"> write operations </a> that requires more data migration. You may have to choose a different shard key to resolve this issue. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> poor network connectivity between shards, which may lead to chunk migrations that take too long to complete. Investigate your network configuration and interconnections between shards. </p> </li> </ul> </li> </ul> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Why do chunk migrations affect sharded cluster performance? <a class="headerlink leafygreen-ui-1kepx47" href="#why-do-chunk-migrations-affect-sharded-cluster-performance-" 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="why-do-chunk-migrations-affect-sharded-cluster-performance-"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If migrations impact your cluster or application's performance, consider the following options, depending on the nature of the impact: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If migrations only interrupt your clusters sporadically, you can limit the <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-sharded-cluster-balancer/#std-label-sharding-schedule-balancing-window"> balancing window </a> to prevent balancing activity during peak hours. Ensure that there is enough time remaining to keep the data from becoming out of balance again. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the balancer is always migrating chunks to the detriment of overall cluster performance: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You may want to attempt <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/modify-chunk-size-in-sharded-cluster/#std-label-tutorial-modifying-chunk-size"> decreasing the chunk size </a> to limit the size of the migration. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your cluster may be over capacity, and you may want to attempt to <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/add-shards-to-shard-cluster/#std-label-sharding-procedure-add-shard"> add one or two shards </a> to the cluster to distribute load. </p> </li> </ul> </li> </ol> <p class="leafygreen-ui-1kp3ins"> It's also possible that your shard key causes your application to direct all writes to a single shard. This kind of activity pattern can require the balancer to migrate most data soon after writing it. You may have to consider <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-reshard-a-collection/#std-label-sharding-resharding"> resharding your collection </a> with a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-choose-a-shard-key/#std-label-sharding-internals-choose-shard-key"> different shard key </a> that provides better <a class="leafygreen-ui-tqgtui" href="/docs/manual/sharding/#std-label-sharding-shard-key-write-scaling"> write scaling <!-- --> . </a> </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/js-bulk/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Bulk Operation Methods <a class="headerlink leafygreen-ui-1kepx47" href="#bulk-operation-methods" 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="bulk-operation-methods"> </div> </a> </h1> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For details on a specific method, including syntax and examples, click on the link to the method's reference page. </p> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB also provides the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.bulkWrite/#mongodb-method-db.collection.bulkWrite"> <code class="leafygreen-ui-1l06pbn"> db.collection.bulkWrite() </code> </a> method for performing bulk write operations. </p> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.initializeOrderedBulkOp/#mongodb-method-db.collection.initializeOrderedBulkOp"> <code class="leafygreen-ui-1l06pbn"> db.collection.initializeOrderedBulkOp() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Initializes a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> operations builder for an ordered list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.initializeUnorderedBulkOp/#mongodb-method-db.collection.initializeUnorderedBulkOp"> <code class="leafygreen-ui-1l06pbn"> db.collection.initializeUnorderedBulkOp() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Initializes a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> operations builder for an unordered list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Bulk operations builder. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.execute/#mongodb-method-Bulk.execute"> <code class="leafygreen-ui-1l06pbn"> Bulk.execute() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Executes a list of operations in bulk. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find/#mongodb-method-Bulk.find"> <code class="leafygreen-ui-1l06pbn"> Bulk.find() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the query condition for an update or a remove operation. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.arrayFilters/#mongodb-method-Bulk.find.arrayFilters"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.arrayFilters() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the filters that determine which elements of an array to update for an <code class="leafygreen-ui-1l06pbn"> update </code> or <code class="leafygreen-ui-1l06pbn"> updateOne </code> operation. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.collation/#mongodb-method-Bulk.find.collation"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.collation() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> collation </a> for the query condition. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.delete/#mongodb-method-Bulk.find.delete"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.delete() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds a multiple document delete operation to a list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.deleteOne/#mongodb-method-Bulk.find.deleteOne"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.deleteOne() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds a single document delete operation to a list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.hint/#mongodb-method-Bulk.find.hint"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.hint() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the index to use for the update/replace operation. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.remove/#mongodb-method-Bulk.find.remove"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.remove() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An alias for <code class="leafygreen-ui-1l06pbn"> Bulk.find.delete() </code> . </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.removeOne/#mongodb-method-Bulk.find.removeOne"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.removeOne() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An alias for <code class="leafygreen-ui-1l06pbn"> Bulk.find.deleteOne() </code> . </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.replaceOne/#mongodb-method-Bulk.find.replaceOne"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.replaceOne() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds a single document replacement operation to a list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.updateOne/#mongodb-method-Bulk.find.updateOne"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.updateOne() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds a single document update operation to a list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.update/#mongodb-method-Bulk.find.update"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.update() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds a <code class="leafygreen-ui-1l06pbn"> multi </code> update operation to a list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.upsert/#mongodb-method-Bulk.find.upsert"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.upsert() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies <code class="leafygreen-ui-1l06pbn"> upsert: true </code> for an update operation. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.getOperations/#mongodb-method-Bulk.getOperations"> <code class="leafygreen-ui-1l06pbn"> Bulk.getOperations() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns an array of write operations executed in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> operations object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.insert/#mongodb-method-Bulk.insert"> <code class="leafygreen-ui-1l06pbn"> Bulk.insert() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds an insert operation to a list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.tojson/#mongodb-method-Bulk.toJSON"> <code class="leafygreen-ui-1l06pbn"> Bulk.toJSON() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a JSON document that contains the number of operations and batches in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> operations object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.toString/#mongodb-method-Bulk.toString"> <code class="leafygreen-ui-1l06pbn"> Bulk.toString() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.tojson/#mongodb-method-Bulk.toJSON"> <code class="leafygreen-ui-1l06pbn"> Bulk.toJSON() </code> </a> results as a string. </div> </div> </td> </tr> </tbody> </table> </div> </section>
https://www.mongodb.com/docs/manual/core/csfle/fundamentals/create-schema/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Encryption Schemas <a class="headerlink leafygreen-ui-1kepx47" href="#encryption-schemas" 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="encryption-schemas"> </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="#encryption-schemas-1" target="_self"> <span> Encryption Schemas </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#encrypt-keyword" target="_self"> <span> encrypt Keyword </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#encryptmetadata-keyword" target="_self"> <span> encryptMetadata Keyword </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#patternproperties-keyword" target="_self"> <span> patternProperties Keyword </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#specify-the-namespace" target="_self"> <span> Specify the Namespace </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#specify-the-data-encryption-key" target="_self"> <span> Specify the Data Encryption Key </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#choose-encryption-rules" target="_self"> <span> Choose Encryption Rules </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#specify-encryption-rules" target="_self"> <span> Specify Encryption Rules </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#view-the-complete-schema" target="_self"> <span> View the Complete Schema </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"> On this page, you can learn how to create an encryption schema for automatic Client-Side Field Level Encryption (CSFLE) as well as see an example detailing how to create the encryption schema used in the CSFLE <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/quick-start/#std-label-csfle-quick-start"> Quick Start <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Encryption Schemas <a class="headerlink leafygreen-ui-1kepx47" href="#encryption-schemas-1" 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="encryption-schemas-1"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> An encryption schema is a JSON object which uses a strict subset of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/draft-zyp-json-schema-04" rel="noopener noreferrer"> <span> JSON Schema Draft 4 standard syntax </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> along with the keywords <code class="leafygreen-ui-1l06pbn"> encrypt </code> and <code class="leafygreen-ui-1l06pbn"> encryptMetadata </code> to define the <strong> encryption rules </strong> that specify how your CSFLE-enabled client should encrypt your documents. </p> <p class="leafygreen-ui-1kp3ins"> Encryption rules are JSON key-value pairs that define how your client application encrypts your fields. You must specify or inherit the following information in an encryption rule: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The algorithm used to encrypt your field </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Which Data Encryption Key (DEK) your client uses to encrypt your field </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://bsonspec.org/" rel="noopener noreferrer"> <span> BSON </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> type of your field </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Encryption rules must contain either the <code class="leafygreen-ui-1l06pbn"> encrypt </code> or <code class="leafygreen-ui-1l06pbn"> encryptMetadata </code> keyword. </p> <p class="leafygreen-ui-1kp3ins"> To learn more about the encryption algorithms you can define in your encryption schema, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/fundamentals/encryption-algorithms/#std-label-csfle-reference-encryption-algorithms"> Fields and Encryption Types <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To learn more about Data Encryption 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> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> encrypt Keyword <a class="headerlink leafygreen-ui-1kepx47" href="#encrypt-keyword" 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-keyword"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> encrypt </code> keyword defines an encryption rule for a single field in a BSON document. Encryption rules containing the <code class="leafygreen-ui-1l06pbn"> encrypt </code> keyword have the following structure: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"&lt;field-name-to-encrypt&gt;\": {\n \"encrypt\": {\n \"algorithm\": \"&lt;encryption&gt;\",\n \"bsonType\": \"&lt;bson&gt;\",\n \"keyId\": [UUID(\"&lt;_id of your Data Encryption Key&gt;\" )]\n }\n}\n","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">"&lt;field-name-to-encrypt&gt;"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"encrypt"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"algorithm"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"&lt;encryption algorithm to use&gt;"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"&lt;bson type of field&gt;"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"keyId"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span>UUID(<span class="lg-highlight-string">"&lt;_id of your Data Encryption Key&gt;"</span> )<span class="lg-highlight-punctuation">]</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> encryptMetadata Keyword <a class="headerlink leafygreen-ui-1kepx47" href="#encryptmetadata-keyword" 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="encryptmetadata-keyword"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> encryptMetadata </code> keyword defines encryption rules which child elements of the sibling <code class="leafygreen-ui-1l06pbn"> properties </code> tag inherit. Encryption rules containing <code class="leafygreen-ui-1l06pbn"> encryptMetadata </code> have the following structure: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"bsonType\": \"object\",\n\"encryptMetadata\": {\n \"algorithm\": \"&lt;encryption&gt;\",\n \"keyId\": [UUID(\"&lt;_id of your Data Encryption Key&gt;\" )]\n},\n\"properties\": { &lt;object&gt; }\n","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"object"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">"encryptMetadata"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"algorithm"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"&lt;encryption algorithm inherited by children of properties field&gt;"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"keyId"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span>UUID(<span class="lg-highlight-string">"&lt;_id of your Data Encryption Key&gt;"</span> )<span class="lg-highlight-punctuation">]</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">"properties"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span> &lt;object to inherit encryptMetadata values&gt; <span class="lg-highlight-punctuation">}</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> <span class="leafygreen-ui-1qnjd6d" id="std-label-csfle-fundamentals-pattern-properties"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> patternProperties Keyword <a class="headerlink leafygreen-ui-1kepx47" href="#patternproperties-keyword" 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="patternproperties-keyword"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can use the <code class="leafygreen-ui-1l06pbn"> patternProperties </code> keyword in your encryption schema to define encryption rules for all fields with names that match a regular expression. This allows you to specify multiple fields for encryption based on a single regular expression, or to specify them by only using a part of the field name. The <code class="leafygreen-ui-1l06pbn"> patternProperties </code> keyword replaces <code class="leafygreen-ui-1l06pbn"> properties </code> in your encryption schema. </p> <p class="leafygreen-ui-1kp3ins"> Specify encryption rules with <code class="leafygreen-ui-1l06pbn"> patternProperties </code> using the following structure: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"bsonType\": \"object\",\n\"patternProperties\": {\n \"&lt;regular&gt;\": {\n \"encrypt\": {\n \"algorithm\": \"&lt;encryption&gt;\",\n \"bsonType\": \"&lt;bson&gt;\",\n \"keyId\": [UUID(\"&lt;_id of your Data Encryption Key&gt;\" )]\n }\n}\n","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"object"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">"patternProperties"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"&lt;regular expression to match&gt;"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"encrypt"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"algorithm"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"&lt;encryption algorithm to use&gt;"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"&lt;bson type of field&gt;"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"keyId"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span>UUID(<span class="lg-highlight-string">"&lt;_id of your Data Encryption Key&gt;"</span> )<span class="lg-highlight-punctuation">]</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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"> To see an example of how to use <code class="leafygreen-ui-1l06pbn"> patternProperties </code> see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/reference/encryption-schemas/#std-label-field-level-encryption-auto-encrypt-with-pattern-properties"> Encryption Schema - Encrypt with Pattern Properties </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-fle-define-a-json-schema"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This example explains how to generate the encryption schema used in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/quick-start/#std-label-csfle-quickstart-encryption-schema"> Create an Encryption Schema For Your Documents </a> step of the CSFLE Quick Start. </p> <p class="leafygreen-ui-1kp3ins"> In the Quick Start, you insert documents with the following structure into the <code class="leafygreen-ui-1l06pbn"> patients </code> collection of the <code class="leafygreen-ui-1l06pbn"> medicalRecords </code> database: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\": { \"$oid\": \"&lt;_id of your document&gt;\" },\n \"name\": \"&lt;name&gt;\",\n \"ssn\": &lt;integer&gt;,\n \"bloodType\": \"&lt;blood&gt;\",\n \"medicalRecords\": [\n { \"weight\": &lt;integer&gt;, \"bloodPressure\": \"&lt;blood&gt;\" }\n ],\n \"insurance\": {\n \"provider\": \"&lt;provider&gt;\",\n \"policyNumber\": &lt;integer&gt;\n }\n}\n","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"_id"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span> <span class="lg-highlight-attr">"$oid"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"&lt;_id of your document&gt;"</span> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"name"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"&lt;name of patient&gt;"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"ssn"</span><span class="lg-highlight-punctuation">:</span> &lt;integer&gt;<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bloodType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"&lt;blood type&gt;"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"medicalRecords"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">{</span> <span class="lg-highlight-attr">"weight"</span><span class="lg-highlight-punctuation">:</span> &lt;integer&gt;<span class="lg-highlight-punctuation">,</span> <span class="lg-highlight-attr">"bloodPressure"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"&lt;blood pressure&gt;"</span> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">]</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"insurance"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"provider"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"&lt;provider name&gt;"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"policyNumber"</span><span class="lg-highlight-punctuation">:</span> &lt;integer&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify the Namespace <a class="headerlink leafygreen-ui-1kepx47" href="#specify-the-namespace" 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="specify-the-namespace"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> At the root of your encryption schema, specify the namespace to which your encryption schema applies. Specify the following to encrypt and decrypt documents in the <code class="leafygreen-ui-1l06pbn"> patients </code> collection of the <code class="leafygreen-ui-1l06pbn"> medicalRecords </code> database: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"medicalRecords.patients\": {\n &lt;the&gt;\n }\n}\n","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"medicalRecords.patients"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;the schema created in the following steps of this example&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify the Data Encryption Key <a class="headerlink leafygreen-ui-1kepx47" href="#specify-the-data-encryption-key" 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="specify-the-data-encryption-key"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> In the Quick Start, you encrypt all fields of your document with a single Data Encryption Key (DEK). To configure all fields in your documents to use a single DEK for encryption and decryption, specify the <code class="leafygreen-ui-1l06pbn"> _id </code> of your DEK with the <code class="leafygreen-ui-1l06pbn"> encryptMetadata </code> keyword at the root of your encryption schema as follows: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"medicalRecords.patients\": {\n \"bsonType\": \"object\",\n \"encryptMetadata\": {\n \"keyId\": [UUID(\"&lt;_id of your Data Encryption Key&gt;\" )]\n },\n \"properties\": {\n &lt;the&gt;\n }\n }\n}\n","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"medicalRecords.patients"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"object"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"encryptMetadata"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"keyId"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span>UUID(<span class="lg-highlight-string">"&lt;_id of your Data Encryption Key&gt;"</span> )<span class="lg-highlight-punctuation">]</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"properties"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;the schema created in the following steps of this example&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Choose Encryption Rules <a class="headerlink leafygreen-ui-1kepx47" href="#choose-encryption-rules" 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="choose-encryption-rules"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You decide to encrypt the following fields with the following encryption algorithms: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:33%"/> <col style="width:34%"/> <col style="width:33%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Encryption Algorithm </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> BSON Type </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> ssn </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deterministic </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Int </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> bloodType </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Random </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> String </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> medicalRecords </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Random </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Array </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> insurance.policyNumber </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deterministic </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Int </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> You choose to encrypt the <code class="leafygreen-ui-1l06pbn"> ssn </code> and <code class="leafygreen-ui-1l06pbn"> insurance.policyNumber </code> fields with deterministic encryption for the following reasons: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You want to be able to query on these fields. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The values in these fields have a high cardinality, so this data is not susceptible to a frequency analysis attack. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> You choose to encrypt the <code class="leafygreen-ui-1l06pbn"> bloodType </code> field with random encryption for the following reasons: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You do not plan to query on this field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The values in this field have low cardinality, making them susceptible to a frequency analysis attack if you encrypted them deterministically. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> You must encrypt the <code class="leafygreen-ui-1l06pbn"> medicalRecords </code> field with random encryption as CSFLE does not support deterministic encryption of fields of type <code class="leafygreen-ui-1l06pbn"> array </code> . </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To learn more about supported and unsupported automatic encryption operations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/reference/supported-operations/#std-label-csfle-reference-automatic-encryption-supported-operations"> Supported Operations for Automatic Encryption <!-- --> . </a> </p> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify Encryption Rules <a class="headerlink leafygreen-ui-1kepx47" href="#specify-encryption-rules" 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="specify-encryption-rules"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To encrypt the <code class="leafygreen-ui-1l06pbn"> ssn </code> field with deterministic encryption, specify the following in your encryption schema: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"ssn\": {\n \"encrypt\": {\n \"bsonType\": \"int\",\n \"algorithm\": \"AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic\"\n }\n}\n","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">"ssn"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"encrypt"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"int"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"algorithm"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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"> To encrypt the <code class="leafygreen-ui-1l06pbn"> bloodType </code> field with random encryption, specify the following in your encryption schema: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"bloodType\": {\n \"encrypt\": {\n \"bsonType\": \"string\",\n \"algorithm\": \"AEAD_AES_256_CBC_HMAC_SHA_512-Random\"\n }\n}\n","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">"bloodType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"encrypt"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"string"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"algorithm"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"AEAD_AES_256_CBC_HMAC_SHA_512-Random"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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"> To encrypt the <code class="leafygreen-ui-1l06pbn"> medicalRecords </code> field with random encryption, specify the following in your encryption schema: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"medicalRecords\": {\n \"encrypt\": {\n \"bsonType\": \"array\",\n \"algorithm\": \"AEAD_AES_256_CBC_HMAC_SHA_512-Random\"\n }\n}\n","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">"medicalRecords"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"encrypt"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"array"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"algorithm"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"AEAD_AES_256_CBC_HMAC_SHA_512-Random"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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"> To encrypt the <code class="leafygreen-ui-1l06pbn"> insurance.policyNumber </code> field with deterministic encryption, specify the following in your encryption schema: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"insurance\": {\n \"bsonType\": \"object\",\n \"properties\": {\n \"policyNumber\": {\n \"encrypt\": {\n \"bsonType\": \"int\",\n \"algorithm\": \"AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic\"\n }\n }\n }\n}\n","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">"insurance"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"object"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"properties"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"policyNumber"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"encrypt"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"int"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"algorithm"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> View the Complete Schema <a class="headerlink leafygreen-ui-1kepx47" href="#view-the-complete-schema" 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="view-the-complete-schema"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The complete encryption schema for the Quick Start is as follows: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"medicalRecords.patients\": {\n \"bsonType\": \"object\",\n \"encryptMetadata\": {\n \"keyId\": [UUID(\"&lt;_id of your Data Encryption Key&gt;\" )]\n },\n \"properties\": {\n \"insurance\": {\n \"bsonType\": \"object\",\n \"properties\": {\n \"policyNumber\": {\n \"encrypt\": {\n \"bsonType\": \"int\",\n \"algorithm\": \"AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic\"\n }\n }\n }\n },\n \"medicalRecords\": {\n \"encrypt\": {\n \"bsonType\": \"array\",\n \"algorithm\": \"AEAD_AES_256_CBC_HMAC_SHA_512-Random\"\n }\n },\n \"bloodType\": {\n \"encrypt\": {\n \"bsonType\": \"string\",\n \"algorithm\": \"AEAD_AES_256_CBC_HMAC_SHA_512-Random\"\n }\n },\n \"ssn\": {\n \"encrypt\": {\n \"bsonType\": \"int\",\n \"algorithm\": \"AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic\"\n }\n }\n }\n }\n}\n","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"medicalRecords.patients"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"object"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"encryptMetadata"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"keyId"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span>UUID(<span class="lg-highlight-string">"&lt;_id of your Data Encryption Key&gt;"</span> )<span class="lg-highlight-punctuation">]</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"properties"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"insurance"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"object"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"properties"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"policyNumber"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"encrypt"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"int"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"algorithm"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"medicalRecords"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"encrypt"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"array"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"algorithm"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"AEAD_AES_256_CBC_HMAC_SHA_512-Random"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bloodType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"encrypt"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"string"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"algorithm"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"AEAD_AES_256_CBC_HMAC_SHA_512-Random"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"ssn"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"encrypt"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"bsonType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"int"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"algorithm"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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> </section> </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 encryption schemas, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/reference/encryption-schemas/#std-label-csfle-reference-encryption-schemas"> CSFLE Encryption Schemas </a> </p> <p class="leafygreen-ui-1kp3ins"> To learn more about automatic encryption, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/fundamentals/automatic-encryption/#std-label-csfle-fundamentals-automatic-encryption"> Automatic Encryption <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To view the Quick Start, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/quick-start/#std-label-csfle-quick-start"> Quick Start <!-- --> . </a> </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/db.getRole/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.getRole() <a class="headerlink leafygreen-ui-1kepx47" href="#db.getrole--" 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.getrole--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#required-access" target="_self"> <span> Required Access </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#show-role-inheritance-information" target="_self"> <span> Show Role Inheritance Information </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#show-role-privileges" target="_self"> <span> Show Role Privileges </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#show-authentication-restrictions" target="_self"> <span> Show Authentication Restrictions </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.getRole(rolename, args) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.getRole" 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-method-db.getRole"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns the roles from which this role inherits privileges. Optionally, the method can also return all the role's privileges. </p> <p class="leafygreen-ui-1kp3ins"> Run <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.getRole" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.getRole() </code> </span> </a> from the database that contains the role. The command can retrieve information for both <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-user-defined-roles/#std-label-user-defined-roles"> user-defined roles </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-built-in-roles"> built-in roles <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.getRole" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.getRole() </code> </span> </a> method accepts the following parameters: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> rolename </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The name of the role. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> args </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. A document specifying additional arguments. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> args </code> document supports the following optional fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> showAuthenticationRestrictions </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Set this field to <code class="leafygreen-ui-1l06pbn"> true </code> to include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createRole/#std-label-create-role-auth-restrictions"> authentication restrictions </a> in the output. Authentication restrictions indicate the IP addresses that users with this role can connect to and from. </p> <p class="leafygreen-ui-1kp3ins"> By default, this field is <code class="leafygreen-ui-1l06pbn"> false </code> , meaning that the <code class="leafygreen-ui-1l06pbn"> db.getRole() </code> output does not include authentication restrictions. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> showBuiltinRoles </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. Set this field to <code class="leafygreen-ui-1l06pbn"> true </code> to include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-built-in-roles"> built-in roles </a> in the output. By default, this field is set to <code class="leafygreen-ui-1l06pbn"> false </code> , and the output for <code class="leafygreen-ui-1l06pbn"> rolesInfo: 1 </code> displays only <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-user-defined-roles/#std-label-user-defined-roles"> user-defined roles <!-- --> . </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> showPrivileges </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. Set this field to <code class="leafygreen-ui-1l06pbn"> true </code> to show role privileges, including both privileges inherited from other roles and privileges defined directly. By default, the command returns only the roles from which this role inherits privileges and does not return specific privileges. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.getRole" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.getRole() </code> </span> </a> wraps the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/rolesInfo/#mongodb-dbcommand-dbcmd.rolesInfo"> <code class="leafygreen-ui-1l06pbn"> rolesInfo </code> </a> command. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Required Access <a class="headerlink leafygreen-ui-1kepx47" href="#required-access" 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="required-access"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To view a role's information, you must be either explicitly granted the role or must have the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-viewRole"> <code class="leafygreen-ui-1l06pbn"> viewRole </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#std-label-security-user-actions"> action </a> on the role's database. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The examples in this section show how to use <code class="leafygreen-ui-1l06pbn"> db.getRoles </code> to: </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="#std-label-db-getRole-example-inheritance" target="_self"> <span> Show Role Inheritance Information </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-db-getRole-example-privileges" target="_self"> <span> Show Role Privileges </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-db-getRole-example-auth-restrictions" target="_self"> <span> Show Authentication Restrictions </span> </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-db-getRole-example-inheritance"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Show Role Inheritance Information <a class="headerlink leafygreen-ui-1kepx47" href="#show-role-inheritance-information" 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="show-role-inheritance-information"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following operation returns role inheritance information for the role <code class="leafygreen-ui-1l06pbn"> associate </code> defined on the <code class="leafygreen-ui-1l06pbn"> products </code> database: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use products\ndb.getRole( \"associate\" )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use products</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">getRole</span>( <span class="lg-highlight-string">"associate"</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"> Example output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: 'products.associate',\n role: 'associate',\n db: 'products',\n roles: [ { role: 'readWrite', db: 'products' } ],\n inheritedRoles: [ { role: 'readWrite', db: 'products' } ],\n isBuiltin: false\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">'products.associate'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">'associate'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">'products'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">'readWrite'</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">'products'</span> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">inheritedRoles</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">'readWrite'</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">'products'</span> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">isBuiltin</span>: <span class="lg-highlight-literal">false</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-db-getRole-example-privileges"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Show Role Privileges <a class="headerlink leafygreen-ui-1kepx47" href="#show-role-privileges" 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="show-role-privileges"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following operation returns role inheritance information <em> and privileges </em> for the role <code class="leafygreen-ui-1l06pbn"> associate </code> defined on the <code class="leafygreen-ui-1l06pbn"> products </code> database: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use products\ndb.getRole( \"associate\", { showPrivileges: true } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use products</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">getRole</span>( <span class="lg-highlight-string">"associate"</span>, <!-- -->{ <span class="lg-highlight-attr">showPrivileges</span>: <span class="lg-highlight-literal">true</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"> Example output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: 'products.associate',\n role: 'associate',\n db: 'products',\n privileges: [\n {\n resource: { db: 'products', collection: '' },\n actions: [ 'bypassDocumentValidation' ]\n }\n ],\n roles: [ { role: 'readWrite', db: 'products' } ],\n inheritedRoles: [ { role: 'readWrite', db: 'products' } ],\n inheritedPrivileges: [\n {\n resource: { db: 'products', collection: '' },\n actions: [ 'bypassDocumentValidation' ]\n },\n {\n resource: { db: 'products', collection: '' },\n actions: [\n 'changeStream',\n 'collStats',\n 'compactStructuredEncryptionData',\n 'convertToCapped',\n 'createCollection',\n 'createIndex',\n 'dbHash',\n 'dbStats',\n 'dropCollection',\n 'dropIndex',\n 'find',\n 'insert',\n 'killCursors',\n 'listCollections',\n 'listIndexes',\n 'planCacheRead',\n 'remove',\n 'renameCollectionSameDB',\n 'update'\n ]\n }\n ],\n isBuiltin: false\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">'products.associate'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">'associate'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">'products'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">privileges</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">resource</span>: <!-- -->{ <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">'products'</span>, <span class="lg-highlight-attr">collection</span>: <span class="lg-highlight-string">''</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">actions</span>: <!-- -->[ <span class="lg-highlight-string">'bypassDocumentValidation'</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">'readWrite'</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">'products'</span> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">inheritedRoles</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">'readWrite'</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">'products'</span> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">inheritedPrivileges</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">resource</span>: <!-- -->{ <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">'products'</span>, <span class="lg-highlight-attr">collection</span>: <span class="lg-highlight-string">''</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">actions</span>: <!-- -->[ <span class="lg-highlight-string">'bypassDocumentValidation'</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">resource</span>: <!-- -->{ <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">'products'</span>, <span class="lg-highlight-attr">collection</span>: <span class="lg-highlight-string">''</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">actions</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'changeStream'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'collStats'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'compactStructuredEncryptionData'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'convertToCapped'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'createCollection'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'createIndex'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'dbHash'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'dbStats'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'dropCollection'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'dropIndex'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'find'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'insert'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'killCursors'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'listCollections'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'listIndexes'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'planCacheRead'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'remove'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'renameCollectionSameDB'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'update'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">isBuiltin</span>: <span class="lg-highlight-literal">false</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-db-getRole-example-auth-restrictions"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Show Authentication Restrictions <a class="headerlink leafygreen-ui-1kepx47" href="#show-authentication-restrictions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="show-authentication-restrictions"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following operation returns role inheritance information and authentication restrictions for the role <code class="leafygreen-ui-1l06pbn"> associate </code> defined on the <code class="leafygreen-ui-1l06pbn"> products </code> database: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use products\ndb.getRole( \"associate\", { showAuthenticationRestrictions: true } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use products</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">getRole</span>( <span class="lg-highlight-string">"associate"</span>, <!-- -->{ <span class="lg-highlight-attr">showAuthenticationRestrictions</span>: <span class="lg-highlight-literal">true</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"> Example output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: 'products.associate',\n role: 'associate',\n db: 'products',\n roles: [ { role: 'readWrite', db: 'products' } ],\n authenticationRestrictions: [\n [ { clientSource: [ '198.51.100.0' ] } ]\n ],\n inheritedRoles: [ { role: 'readWrite', db: 'products' } ],\n inheritedAuthenticationRestrictions: [\n [ { clientSource: [ '198.51.100.0' ] } ]\n ],\n isBuiltin: false\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">'products.associate'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">'associate'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">'products'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">'readWrite'</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">'products'</span> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">authenticationRestrictions</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">clientSource</span>: <!-- -->[ <span class="lg-highlight-string">'198.51.100.0'</span> ] } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">inheritedRoles</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">'readWrite'</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">'products'</span> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">inheritedAuthenticationRestrictions</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">clientSource</span>: <!-- -->[ <span class="lg-highlight-string">'198.51.100.0'</span> ] } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">isBuiltin</span>: <span class="lg-highlight-literal">false</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/exit-codes/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Exit Codes and Statuses for a Self-Managed Deployment <a class="headerlink leafygreen-ui-1kepx47" href="#exit-codes-and-statuses-for-a-self-managed-deployment" 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="exit-codes-and-statuses-for-a-self-managed-deployment"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> MongoDB will return one of the following codes and statuses when exiting. Use this guide to interpret logs and when troubleshooting issues with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-exit-codes"> </span> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:12%"/> <col style="width:88%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Code </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Cause </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 0 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-0" 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-error-0"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned by MongoDB applications upon successful exit. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 1 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-1" 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-error-1"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> as a generic failure when no other error codes apply. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 2 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-2" 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-error-2"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The specified options are in error or are incompatible with other options. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 3 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-3" 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-error-3"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> if there is a mismatch between hostnames specified on the command line and in the <code class="leafygreen-ui-1l06pbn"> local.sources </code> collection when running a replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 4 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-4" 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-error-4"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The version of the database is different from the version supported by the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> (or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod.exe/#mongodb-binary-bin.mongod.exe"> <code class="leafygreen-ui-1l06pbn"> mongod.exe </code> </a> ) instance. The instance exits cleanly. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 5 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-5" 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-error-5"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> if a problem is encountered during initialization. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 12 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-12" 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-error-12"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned by the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod.exe/#mongodb-binary-bin.mongod.exe"> <code class="leafygreen-ui-1l06pbn"> mongod.exe </code> </a> process on Windows when it receives a Control-C, Close, Break or Shutdown event. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 14 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-14" 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-error-14"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned by MongoDB applications which encounter an unrecoverable error, an uncaught exception or uncaught signal. The system exits without performing a clean shutdown. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 20 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-20" 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-error-20"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> <em> Message: </em> <code class="leafygreen-ui-1l06pbn"> ERROR: wsastartup failed &lt;reason&gt; </code> </p> <p class="leafygreen-ui-1kp3ins"> Returned by MongoDB applications on Windows following an error in the WSAStartup function, used to initialize the networking subsystem. </p> <p class="leafygreen-ui-1kp3ins"> <em> Message: </em> <code class="leafygreen-ui-1l06pbn"> NT Service Error </code> </p> <p class="leafygreen-ui-1kp3ins"> Returned by MongoDB applications for Windows due to failures installing, starting or removing the NT Service for the application. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 48 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-48" 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-error-48"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> when an error prevents a newly started instance from listening for incoming connections. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 50 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-50" 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-error-50"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> during server initialization if it fails to fork the process. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 51 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-51" 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-error-51"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> during server initialization if the daemon fails to send a ready signal. The process exits cleanly. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 61 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-61" 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-error-61"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned by the <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/monitoring/#std-label-storage-node-watchdog"> Storage Node Watchdog </a> if any of the filesystems with monitored directories are unresponsive. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 62 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-62" 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-error-62"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Returned by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> when the datafiles in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--dbpath"> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> </a> are incompatible with the version of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> currently running. </p> <p class="leafygreen-ui-1kp3ins"> To resolve data incompatibility issues after upgrading, please refer to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/6.0/#std-label-release-notes-6.0"> release notes </a> for your version of MongoDB and search for "Changes Affecting Compatibility." </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 87 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-87" 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-error-87"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> when the process health check triggers a crash. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 100 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-100" 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-error-100"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> when the process throws an uncaught exception. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 102 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-102" 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-error-102"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> when the process fails to rotate audit logs on startup. </div> </div> </td> </tr> </tbody> </table> </div> </section>
https://www.mongodb.com/docs/manual/reference/method/db.collection.distinct/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.collection.distinct() <a class="headerlink leafygreen-ui-1kepx47" href="#db.collection.distinct--" 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.collection.distinct--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#options" target="_self"> <span> Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <div class="leafygreen-ui-147elvs"> <p class="leafygreen-ui-1ronz74"> MongoDB with drivers </p> <div class="leafygreen-ui-18k5rfm"> <p class="leafygreen-ui-1kp3ins"> This page documents 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> method. To see the equivalent method in a MongoDB driver, see the corresponding page for your programming language: </p> </div> <div class="leafygreen-ui-zgrwqu notranslate"> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/drivers/csharp/current/quick-reference/#quick-reference" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_1351_59964)"> <g clip-path="url(#clip1_1351_59964)"> <path d="M25.7709 9.2495C25.7709 8.79827 25.678 8.39408 25.4827 8.04627C25.2874 7.70785 25.0084 7.42586 24.627 7.20025C21.465 5.35781 18.2937 3.51538 15.1317 1.67295C14.2761 1.17474 13.4484 1.19354 12.6021 1.70115C11.3466 2.45316 5.04112 6.10042 3.15321 7.20025C2.3813 7.65142 2 8.34705 2 9.24005C2 12.9531 2 16.6568 2 20.3698C2 20.8117 2.093 21.2064 2.279 21.5449C2.4743 21.8927 2.7626 22.1841 3.15321 22.4191C5.03182 23.5189 11.3373 27.1662 12.6021 27.9182C13.4484 28.4258 14.2761 28.4446 15.1317 27.9463C18.2937 26.1039 21.465 24.2615 24.627 22.4191C25.0177 22.1935 25.306 21.9021 25.5012 21.5449C25.6873 21.2064 25.7803 20.8117 25.7803 20.3698C25.7709 20.3698 25.7709 12.9531 25.7709 9.2495Z" fill="#A179DC"> </path> <path d="M13.9227 14.7673L2.27905 21.5449C2.47435 21.8927 2.76265 22.1841 3.15326 22.4191C5.03187 23.5189 11.3373 27.1662 12.6021 27.9182C13.4484 28.4258 14.2762 28.4445 15.1317 27.9463C18.2938 26.1039 21.4651 24.2615 24.6271 22.4191C25.0177 22.1935 25.306 21.9021 25.5013 21.5449L13.9227 14.7673Z" fill="#280068"> </path> <path d="M25.7711 9.24949C25.7711 8.79827 25.6781 8.39408 25.4828 8.04626L13.9229 14.7768L25.4921 21.5543C25.6781 21.2159 25.7711 20.8211 25.7711 20.3793C25.7711 20.3699 25.7711 12.9531 25.7711 9.24949Z" fill="#390091"> </path> <path d="M20.7771 12.2387V13.5078H22.0325V12.2387H22.6557V13.5078H23.9111V14.1376H22.6557V15.4066H23.9111V16.0364H22.6557V17.3054H22.0325V16.0364H20.7771V17.3054H20.1539V16.0364H18.8984V15.4066H20.1539V14.1376H18.8984V13.5078H20.1539V12.2387H20.7771ZM22.0325 14.1376H20.7771V15.4066H22.0325V14.1376Z" fill="white"> </path> <path d="M13.9508 5.87482C17.2151 5.87482 20.0702 7.67022 21.6047 10.3399L21.5861 10.3117L17.7452 12.5489C16.9919 11.2517 15.5969 10.3775 14.0066 10.3587H13.9601C11.5328 10.3587 9.56116 12.3515 9.56116 14.805C9.56116 15.604 9.77503 16.3654 10.1377 17.014C10.9004 18.3488 12.3232 19.2512 13.9601 19.2512C15.6062 19.2512 17.0384 18.3394 17.7917 16.9858L17.7731 17.014L21.614 19.2606C20.0981 21.9021 17.2895 23.6975 14.0531 23.7257H13.9508C10.6679 23.7257 7.81274 21.9209 6.28753 19.2418C5.54353 17.9352 5.11572 16.4124 5.11572 14.7956C5.11572 9.87931 9.06825 5.87482 13.9508 5.87482Z" fill="white"> </path> </g> </g> <defs> <clippath id="clip0_1351_59964"> <rect fill="white" height="28" transform="translate(0 0.809265)" width="28"> </rect> </clippath> <clippath id="clip1_1351_59964"> <rect fill="white" height="27" transform="translate(2 1.30966)" width="24"> </rect> </clippath> </defs> </svg> <span> C# </span> </a> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/drivers/java/sync/current/usage-examples/distinct/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 30 41" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M10.0921 30.7949C10.0921 30.7949 8.57608 31.6793 11.166 31.9636C14.2929 32.311 15.9037 32.2794 19.3464 31.6161C19.3464 31.6161 20.2623 32.1846 21.5257 32.6901C13.7876 35.9748 4.02791 32.5005 10.0921 30.7949Z" fill="#0074BD"> </path> <path d="M9.14539 26.4678C9.14539 26.4678 7.43985 27.7312 10.0298 27.9838C13.3778 28.3312 15.9992 28.3628 20.579 27.4785C20.579 27.4785 21.2107 28.1101 22.1898 28.4576C12.8724 31.2054 2.44949 28.6787 9.14539 26.4678Z" fill="#0074BD"> </path> <path d="M17.1039 19.1398C18.9989 21.3191 16.5985 23.3089 16.5985 23.3089C16.5985 23.3089 21.431 20.8138 19.2201 17.6869C17.1355 14.7811 15.5563 13.3282 24.1788 8.33789C24.1473 8.33789 10.6607 11.6858 17.1039 19.1398Z" fill="#EA2D2E"> </path> <path d="M27.3377 33.9845C27.3377 33.9845 28.4431 34.9004 26.1059 35.6269C21.6525 36.985 7.53417 37.3957 3.61769 35.6901C2.19639 35.0899 4.84949 34.2372 5.67069 34.0477C6.52347 33.8582 7.02884 33.8898 7.02884 33.8898C5.44961 32.7843 -3.10981 36.0691 2.67016 36.9851C18.4308 39.5433 31.4121 35.8164 27.3377 33.9845Z" fill="#0074BD"> </path> <path d="M10.8194 21.983C10.8194 21.983 3.6497 23.6885 8.2926 24.3203C10.2509 24.5729 14.1357 24.5097 17.7995 24.2255C20.7685 23.9728 23.7375 23.4359 23.7375 23.4359C23.7375 23.4359 22.6951 23.8781 21.9372 24.415C14.6411 26.3416 0.585992 25.4257 4.62881 23.4675C8.00839 21.7935 10.8194 21.983 10.8194 21.983Z" fill="#0074BD"> </path> <path d="M23.6745 29.1846C31.0969 25.3313 27.6542 21.6359 25.2538 22.1413C24.6537 22.2676 24.401 22.3623 24.401 22.3623C24.401 22.3623 24.6221 22.0149 25.0327 21.8886C29.7703 20.2146 33.4025 26.7842 23.5166 29.4057C23.5482 29.3741 23.6429 29.2794 23.6745 29.1846Z" fill="#0074BD"> </path> <path d="M19.2206 0.25293C19.2206 0.25293 23.3266 4.35891 15.3357 10.6758C8.92404 15.7293 13.8828 18.6351 15.3357 21.9199C11.6087 18.5403 8.86088 15.5714 10.6928 12.792C13.3775 8.74919 20.863 6.79093 19.2206 0.25293Z" fill="#EA2D2E"> </path> <path d="M11.5455 39.6068C18.6521 40.049 29.5803 39.3541 29.833 35.9746C29.833 35.9746 29.3276 37.238 23.9583 38.2487C17.894 39.3858 10.4085 39.2594 5.95508 38.533C5.95508 38.5646 6.87103 39.3225 11.5455 39.6068Z" fill="#0074BD"> </path> </svg> <span> Java Sync </span> </a> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/drivers/node/current/fundamentals/crud/read-operations/distinct/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 30 30" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:R2dtlqcmqn9:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":R2dtlqcmqn9:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":R2dtlqcmqn9:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":R2dtlqcmqn9:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <span> Node.js </span> </a> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/languages/python/pymongo-driver/current/read/distinct/" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 111.6 147" width="24" xmlns="http://www.w3.org/2000/svg"> <lineargradient gradienttransform="matrix(.5625 0 0 -.568 -160.323 -146.09)" gradientunits="userSpaceOnUse" id=":R2htlqcmqn9:aa" x1="280.848" x2="389.865" y1="-268.463" y2="-362.257"> <stop offset="0" stop-color="#5a9fd4"> </stop> <stop offset="1" stop-color="#306998"> </stop> </lineargradient> <path d="M55.3 3.2c-4.6 0-9 .4-12.8 1.1-11.3 2-13.4 6.2-13.4 13.9v10.2h26.8v3.4H19c-7.8 0-14.6 4.7-16.8 13.6C-.3 55.6-.4 62 2.2 72.7c1.9 7.9 6.5 13.6 14.2 13.6h9.2V74c0-8.8 7.7-16.7 16.7-16.7h26.8c7.5 0 13.4-6.1 13.4-13.6V18.2c0-7.3-6.1-12.7-13.4-13.9-4.4-.8-9.2-1.1-13.8-1.1zm-14.5 8.2c2.8 0 5 2.3 5 5.1s-2.3 5.1-5 5.1c-2.8 0-5-2.3-5-5.1s2.2-5.1 5-5.1z" fill="url(#:R2htlqcmqn9:aa)"> </path> <lineargradient gradienttransform="matrix(.5625 0 0 -.568 -160.323 -146.09)" gradientunits="userSpaceOnUse" id=":R2htlqcmqn9:bb" x1="432.011" x2="393.081" y1="-419.025" y2="-363.946"> <stop offset="0" stop-color="#ffd43b"> </stop> <stop offset="1" stop-color="#ffe873"> </stop> </lineargradient> <path d="M86 31.8v11.9c0 9.2-7.8 17-16.8 17H42.5c-7.3 0-13.4 6.3-13.4 13.6v25.5c0 7.3 6.3 11.5 13.4 13.6 8.5 2.5 16.6 2.9 26.8 0 6.8-2 13.4-5.9 13.4-13.6V89.7H55.9v-3.4h40.2c7.8 0 10.7-5.4 13.4-13.6 2.8-8.4 2.7-16.5 0-27.3-1.9-7.8-5.6-13.6-13.4-13.6H86zM71 96.5c2.8 0 5 2.3 5 5.1s-2.3 5.1-5 5.1c-2.8 0-5-2.3-5-5.1-.1-2.8 2.2-5.1 5-5.1z" fill="url(#:R2htlqcmqn9:bb)"> </path> <radialgradient cx="-2274.721" cy="144.526" gradienttransform="matrix(0 -.2399 -1.0547 0 208.637 -414.922)" gradientunits="userSpaceOnUse" id=":R2htlqcmqn9:cc" r="29.037"> <stop offset="0" stop-color="#b8b8b8" stop-opacity=".498"> </stop> <stop offset="1" stop-color="#7f7f7f" stop-opacity="0"> </stop> </radialgradient> <path d="M92.1 130.9c0 3.8-16.1 7-35.9 7s-35.9-3.1-35.9-7c0-3.8 16.1-7 35.9-7s35.9 3.1 35.9 7z" fill="url(#:R2htlqcmqn9:cc)" opacity=".444"> </path> </svg> <span> PyMongo </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/languages/cpp/cpp-driver/upcoming/read/distinct/#distinct---method" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_1351_59959)"> <g clip-path="url(#clip1_1351_59959)"> <path d="M25.4013 21.5646C25.5872 21.2353 25.7034 20.8745 25.7034 20.5373V9.08012C25.7034 8.75078 25.5872 8.38217 25.4013 8.05283L13.8516 14.8127L25.4013 21.5646Z" fill="#00599C"> </path> <path d="M14.8738 28.0657L24.6729 22.3411C24.9517 22.1764 25.2151 21.8941 25.401 21.5647L13.8513 14.8127L2.30151 21.5647C2.48743 21.8941 2.74305 22.1764 3.02967 22.3411L12.8288 28.0657C13.3865 28.3951 14.316 28.3951 14.8738 28.0657Z" fill="#004482"> </path> <path d="M25.4011 8.06086C25.2152 7.73146 24.9596 7.44915 24.673 7.2845L14.8739 1.55983C14.3084 1.23046 13.3866 1.23046 12.8211 1.55983L3.02202 7.2845C2.46429 7.61385 1.99951 8.42158 1.99951 9.08033V20.5375C1.99951 20.8669 2.11571 21.2354 2.30162 21.5647L13.8514 14.8128L25.4011 8.06086Z" fill="#659AD2"> </path> <path d="M13.8512 22.8115C9.49778 22.8115 5.94995 19.2199 5.94995 14.8127C5.94995 10.4055 9.49778 6.81387 13.8512 6.81387C16.6631 6.81387 19.2813 8.34305 20.6912 10.8133L17.2751 12.813C16.5701 11.5818 15.261 10.8133 13.8512 10.8133C11.6745 10.8133 9.90055 12.6091 9.90055 14.8127C9.90055 17.0163 11.6745 18.8121 13.8512 18.8121C15.261 18.8121 16.5701 18.0436 17.2751 16.8124L20.6912 18.8121C19.2813 21.2745 16.6631 22.8115 13.8512 22.8115Z" fill="white"> </path> <path d="M21.7524 14.3657H20.8771V13.4796H19.994V14.3657H19.1187V15.2518H19.994V16.1458H20.8771V15.2518H21.7524V14.3657Z" fill="white"> </path> <path d="M25.0446 14.3657H24.1693V13.4796H23.2862V14.3657H22.4109V15.2518H23.2862V16.1458H24.1693V15.2518H25.0446V14.3657Z" fill="white"> </path> </g> </g> <defs> <clippath id="clip0_1351_59959"> <rect fill="white" height="28" transform="translate(0 0.809265)" width="28"> </rect> </clippath> <clippath id="clip1_1351_59959"> <rect fill="white" height="27" transform="translate(1.99951 1.30878)" width="24"> </rect> </clippath> </defs> </svg> <span> C++ </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/drivers/go/master/fundamentals/crud/read-operations/distinct/#distinct" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" id="Layer_1" style="fill:#00ACD7" version="1.1" viewbox="0 0 205.4 76.7" width="24" x="0" xmlns="http://www.w3.org/2000/svg" y="0"> <path class="st00" d="M15.5 23.2c-.4 0-.5-.2-.3-.5l2.1-2.7c.2-.3.7-.5 1.1-.5h35.7c.4 0 .5.3.3.6l-1.7 2.6c-.2.3-.7.6-1 .6l-36.2-.1zM.4 32.4c-.4 0-.5-.2-.3-.5l2.1-2.7c.2-.3.7-.5 1.1-.5h45.6c.4 0 .6.3.5.6l-.8 2.4c-.1.4-.5.6-.9.6l-47.3.1zM24.6 41.6c-.4 0-.5-.3-.3-.6l1.4-2.5c.2-.3.6-.6 1-.6h20c.4 0 .6.3.6.7l-.2 2.4c0 .4-.4.7-.7.7l-21.8-.1z"> </path> <g id="CXHf1q_3_"> <path class="st00" d="M128.4 21.4c-6.3 1.6-10.6 2.8-16.8 4.4-1.5.4-1.6.5-2.9-1-1.5-1.7-2.6-2.8-4.7-3.8-6.3-3.1-12.4-2.2-18.1 1.5-6.8 4.4-10.3 10.9-10.2 19 .1 8 5.6 14.6 13.5 15.7 6.8.9 12.5-1.5 17-6.6.9-1.1 1.7-2.3 2.7-3.7H89.6c-2.1 0-2.6-1.3-1.9-3 1.3-3.1 3.7-8.3 5.1-10.9.3-.6 1-1.6 2.5-1.6h36.4c-.2 2.7-.2 5.4-.6 8.1-1.1 7.2-3.8 13.8-8.2 19.6-7.2 9.5-16.6 15.4-28.5 17-9.8 1.3-18.9-.6-26.9-6.6-7.4-5.6-11.6-13-12.7-22.2-1.3-10.9 1.9-20.7 8.5-29.3C70.4 8.7 79.8 2.8 91.3.7c9.4-1.7 18.4-.6 26.5 4.9 5.3 3.5 9.1 8.3 11.6 14.1.6.9.2 1.4-1 1.7z"> </path> <path class="st00" d="M161.5 76.7c-9.1-.2-17.4-2.8-24.4-8.8-5.9-5.1-9.6-11.6-10.8-19.3-1.8-11.3 1.3-21.3 8.1-30.2 7.3-9.6 16.1-14.6 28-16.7 10.2-1.8 19.8-.8 28.5 5.1 7.9 5.4 12.8 12.7 14.1 22.3 1.7 13.5-2.2 24.5-11.5 33.9-6.6 6.7-14.7 10.9-24 12.8-2.7.5-5.4.6-8 .9zm23.8-40.4c-.1-1.3-.1-2.3-.3-3.3-1.8-9.9-10.9-15.5-20.4-13.3-9.3 2.1-15.3 8-17.5 17.4-1.8 7.8 2 15.7 9.2 18.9 5.5 2.4 11 2.1 16.3-.6 7.9-4.1 12.2-10.5 12.7-19.1z"> </path> </g> </svg> <span> Go </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongodb-driver-reactivestreams/com/mongodb/reactivestreams/client/MongoCollection.html#distinct(java.lang.String,java.lang.Class)" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 30 41" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M10.0921 30.7949C10.0921 30.7949 8.57608 31.6793 11.166 31.9636C14.2929 32.311 15.9037 32.2794 19.3464 31.6161C19.3464 31.6161 20.2623 32.1846 21.5257 32.6901C13.7876 35.9748 4.02791 32.5005 10.0921 30.7949Z" fill="#0074BD"> </path> <path d="M9.14539 26.4678C9.14539 26.4678 7.43985 27.7312 10.0298 27.9838C13.3778 28.3312 15.9992 28.3628 20.579 27.4785C20.579 27.4785 21.2107 28.1101 22.1898 28.4576C12.8724 31.2054 2.44949 28.6787 9.14539 26.4678Z" fill="#0074BD"> </path> <path d="M17.1039 19.1398C18.9989 21.3191 16.5985 23.3089 16.5985 23.3089C16.5985 23.3089 21.431 20.8138 19.2201 17.6869C17.1355 14.7811 15.5563 13.3282 24.1788 8.33789C24.1473 8.33789 10.6607 11.6858 17.1039 19.1398Z" fill="#EA2D2E"> </path> <path d="M27.3377 33.9845C27.3377 33.9845 28.4431 34.9004 26.1059 35.6269C21.6525 36.985 7.53417 37.3957 3.61769 35.6901C2.19639 35.0899 4.84949 34.2372 5.67069 34.0477C6.52347 33.8582 7.02884 33.8898 7.02884 33.8898C5.44961 32.7843 -3.10981 36.0691 2.67016 36.9851C18.4308 39.5433 31.4121 35.8164 27.3377 33.9845Z" fill="#0074BD"> </path> <path d="M10.8194 21.983C10.8194 21.983 3.6497 23.6885 8.2926 24.3203C10.2509 24.5729 14.1357 24.5097 17.7995 24.2255C20.7685 23.9728 23.7375 23.4359 23.7375 23.4359C23.7375 23.4359 22.6951 23.8781 21.9372 24.415C14.6411 26.3416 0.585992 25.4257 4.62881 23.4675C8.00839 21.7935 10.8194 21.983 10.8194 21.983Z" fill="#0074BD"> </path> <path d="M23.6745 29.1846C31.0969 25.3313 27.6542 21.6359 25.2538 22.1413C24.6537 22.2676 24.401 22.3623 24.401 22.3623C24.401 22.3623 24.6221 22.0149 25.0327 21.8886C29.7703 20.2146 33.4025 26.7842 23.5166 29.4057C23.5482 29.3741 23.6429 29.2794 23.6745 29.1846Z" fill="#0074BD"> </path> <path d="M19.2206 0.25293C19.2206 0.25293 23.3266 4.35891 15.3357 10.6758C8.92404 15.7293 13.8828 18.6351 15.3357 21.9199C11.6087 18.5403 8.86088 15.5714 10.6928 12.792C13.3775 8.74919 20.863 6.79093 19.2206 0.25293Z" fill="#EA2D2E"> </path> <path d="M11.5455 39.6068C18.6521 40.049 29.5803 39.3541 29.833 35.9746C29.833 35.9746 29.3276 37.238 23.9583 38.2487C17.894 39.3858 10.4085 39.2594 5.95508 38.533C5.95508 38.5646 6.87103 39.3225 11.5455 39.6068Z" fill="#0074BD"> </path> </svg> <span> Java RS </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/drivers/kotlin/coroutine/current/usage-examples/distinct/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M28 29H0V1H28L14 15L28 29Z" fill="url(#:R31tlqcmqn9:paint0_linear_211_40588)"> </path> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":R31tlqcmqn9:paint0_linear_211_40588" x1="28" x2="8.34465e-07" y1="0.999999" y2="29"> <stop offset="0.00343514" stop-color="#E44857"> </stop> <stop offset="0.4689" stop-color="#C711E1"> </stop> <stop offset="1" stop-color="#7F52FF"> </stop> </lineargradient> </defs> </svg> <span> Kotlin Coroutine </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/languages/kotlin/kotlin-sync-driver/current/read/distinct/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M28 29H0V1H28L14 15L28 29Z" fill="url(#:R35tlqcmqn9:paint0_linear_211_40588)"> </path> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":R35tlqcmqn9:paint0_linear_211_40588" x1="28" x2="8.34465e-07" y1="0.999999" y2="29"> <stop offset="0.00343514" stop-color="#E44857"> </stop> <stop offset="0.4689" stop-color="#C711E1"> </stop> <stop offset="1" stop-color="#7F52FF"> </stop> </lineargradient> </defs> </svg> <span> Kotlin Sync </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/php-library/current/reference/method/MongoDBCollection-distinct/" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 700 301" width="24" x="0" xmlns="http://www.w3.org/2000/svg" y="0"> <defs> <clippath clippathunits="userSpaceOnUse" id="a"> <path d="M11.52 162C11.52 81.677 135.307 16.561 288 16.561S564.481 81.677 564.481 162c0 80.322-123.788 145.439-276.481 145.439-152.693 0-276.48-65.117-276.48-145.439"> </path> </clippath> <clippath clippathunits="userSpaceOnUse" id="c"> <path d="M0 324h576V0H0v324z"> </path> </clippath> <clippath clippathunits="userSpaceOnUse" id="d"> <path d="M0 324h576V0H0v324z"> </path> </clippath> <radialgradient cx="0" cy="0" fx="0" fy="0" gradienttransform="matrix(363.05789 0 0 -363.05789 177.52 256.307)" gradientunits="userSpaceOnUse" id="b" r="1" spreadmethod="pad"> <stop offset="0" stop-color="#aeb2d5"> </stop> <stop offset=".3" stop-color="#aeb2d5"> </stop> <stop offset=".75" stop-color="#484c89"> </stop> <stop offset="1" stop-color="#484c89"> </stop> </radialgradient> </defs> <g clip-path="url(#a)" transform="matrix(1.25 0 0 -1.25 -4.4 394.299)"> <path d="M11.52 162C11.52 81.677 135.307 16.561 288 16.561S564.481 81.677 564.481 162c0 80.322-123.788 145.439-276.481 145.439-152.693 0-276.48-65.117-276.48-145.439" fill="url(#b)"> </path> </g> <g clip-path="url(#c)" transform="matrix(1.25 0 0 -1.25 -4.4 394.299)"> <path d="M288 27.36c146.729 0 265.68 60.28 265.68 134.64 0 74.36-118.951 134.641-265.68 134.641S22.32 236.36 22.32 162.001C22.32 87.64 141.271 27.358 288 27.358" fill="#777bb3"> </path> </g> <g clip-path="url(#d)" transform="matrix(1.25 0 0 -1.25 -4.4 394.299)"> <path d="M161.734 145.307c12.065 0 21.072 2.225 26.771 6.61 5.638 4.342 9.532 11.863 11.573 22.354 1.903 9.806 1.178 16.653-2.154 20.348-3.407 3.774-10.773 5.688-21.893 5.688h-19.28l-10.69-55h15.673zm-63.063-67.75a2.998 2.998 0 00-2.944 3.572l28.328 145.75a3 3 0 002.945 2.428h61.054c19.188 0 33.47-5.21 42.447-15.487 9.025-10.331 11.812-24.772 8.283-42.921-1.436-7.394-3.906-14.261-7.34-20.41-3.44-6.154-7.985-11.85-13.512-16.93-6.616-6.191-14.104-10.681-22.236-13.323-8.003-2.607-18.28-3.93-30.548-3.93h-24.722l-7.06-36.321a3 3 0 00-2.944-2.428h-31.75z"> </path> <path d="M159.224 197.307h16.808c13.42 0 18.083-2.945 19.667-4.7 2.628-2.914 3.124-9.058 1.435-17.767-1.898-9.75-5.416-16.663-10.458-20.545-5.162-3.974-13.554-5.988-24.941-5.988H149.7l9.523 49zm28.83 35H127a6 6 0 01-5.89-4.855L92.784 81.702a6 6 0 015.889-7.144h31.75a6 6 0 015.89 4.854l6.588 33.895h22.249c12.582 0 23.174 1.372 31.479 4.077 8.54 2.775 16.399 7.48 23.354 13.984 5.752 5.292 10.49 11.232 14.08 17.657 3.59 6.427 6.17 13.594 7.668 21.302 3.715 19.104.697 34.402-8.97 45.466-9.571 10.958-24.613 16.514-44.705 16.514m-45.633-90h19.313c12.8 0 22.336 2.411 28.6 7.234 6.267 4.824 10.493 12.875 12.689 24.157 2.1 10.832 1.144 18.476-2.871 22.93-4.02 4.452-12.06 6.68-24.121 6.68h-21.754l-11.856-61m45.633 84c18.367 0 31.766-4.82 40.188-14.462 8.42-9.64 10.957-23.098 7.597-40.375-1.383-7.117-3.722-13.624-7.015-19.519-3.297-5.899-7.602-11.293-12.922-16.184-6.34-5.933-13.383-10.16-21.133-12.679-7.75-2.525-17.621-3.782-29.621-3.782h-27.196l-7.531-38.75h-31.75L127 226.307h61.055" fill="#fff"> </path> <path d="M311.583 116.307c-.896 0-1.745.4-2.314 1.092a2.994 2.994 0 00-.631 2.48l12.531 64.489c1.192 6.133.898 10.535-.827 12.395-1.056 1.137-4.228 3.044-13.607 3.044h-22.702l-15.755-81.072a3 3 0 00-2.945-2.428h-31.5a2.998 2.998 0 00-2.945 3.572l28.328 145.75a3 3 0 002.945 2.428h31.5a3 3 0 002.945-3.572l-6.836-35.178h24.422c18.605 0 31.221-3.28 38.569-10.028 7.49-6.884 9.827-17.891 6.947-32.72l-13.18-67.824a3 3 0 00-2.945-2.428h-32z"> </path> <path d="M293.661 271.057h-31.5a6 6 0 01-5.89-4.855l-28.328-145.75a5.998 5.998 0 015.89-7.145h31.5a6 6 0 015.89 4.855l15.283 78.645h20.23c9.362 0 11.327-2 11.406-2.086.568-.61 1.315-3.44.082-9.78l-12.53-64.49a5.998 5.998 0 015.89-7.144h32a6 6 0 015.89 4.855l13.178 67.825c3.093 15.921.447 27.864-7.86 35.5-7.929 7.281-21.209 10.82-40.6 10.82h-20.784l6.143 31.605a6.001 6.001 0 01-5.89 7.145m0-6l-7.53-38.75h28.061c17.657 0 29.836-3.082 36.54-9.238 6.702-6.16 8.71-16.14 6.031-29.938l-13.18-67.824h-32l12.531 64.488c1.426 7.336.902 12.34-1.574 15.008-2.477 2.668-7.746 4.004-15.805 4.004H281.56l-16.226-83.5h-31.5l28.328 145.75h31.5" fill="#fff"> </path> <path d="M409.55 145.307c12.065 0 21.072 2.225 26.77 6.61 5.639 4.34 9.533 11.862 11.575 22.354 1.903 9.806 1.178 16.653-2.155 20.348-3.407 3.774-10.773 5.688-21.893 5.688h-19.281l-10.69-55h15.674zm-63.062-67.75a2.999 2.999 0 00-2.945 3.572l28.328 145.75a3.002 3.002 0 002.946 2.428h61.053c19.189 0 33.47-5.21 42.448-15.487 9.025-10.33 11.81-24.771 8.283-42.921-1.438-7.394-3.907-14.261-7.342-20.41-3.44-6.154-7.984-11.85-13.511-16.93-6.616-6.191-14.104-10.681-22.236-13.323-8.003-2.607-18.281-3.93-30.548-3.93H388.24l-7.057-36.321a3.001 3.001 0 00-2.946-2.428h-31.75z"> </path> <path d="M407.04 197.307h16.807c13.421 0 18.083-2.945 19.667-4.7 2.63-2.914 3.125-9.058 1.435-17.766-1.898-9.75-5.417-16.664-10.458-20.546-5.162-3.974-13.554-5.988-24.94-5.988h-12.034l9.522 49zm28.83 35h-61.054a6 6 0 01-5.889-4.855L340.6 81.702a6 6 0 015.889-7.144h31.75a6 6 0 015.89 4.854l6.587 33.895h22.25c12.581 0 23.173 1.372 31.478 4.077 8.541 2.775 16.401 7.481 23.356 13.986 5.752 5.291 10.488 11.23 14.078 17.655 3.591 6.427 6.171 13.594 7.668 21.302 3.715 19.105.697 34.403-8.969 45.467-9.572 10.957-24.613 16.513-44.706 16.513m-45.632-90h19.312c12.801 0 22.336 2.411 28.601 7.234 6.267 4.824 10.492 12.875 12.688 24.157 2.102 10.832 1.145 18.476-2.87 22.93-4.02 4.452-12.06 6.68-24.122 6.68h-21.754l-11.855-61m45.632 84c18.367 0 31.766-4.82 40.188-14.462 8.422-9.64 10.957-23.098 7.597-40.375-1.383-7.117-3.722-13.624-7.015-19.519-3.297-5.899-7.602-11.293-12.922-16.184-6.34-5.933-13.383-10.16-21.133-12.679-7.75-2.525-17.62-3.782-29.62-3.782h-27.197l-7.53-38.75h-31.75l28.328 145.75h61.054" fill="#fff"> </path> </g> </svg> <span> PHP </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.rubydoc.info/github/mongoid/mongoid/Mongoid%2FContextual%2FMongo:distinct" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" preserveaspectratio="xMidYMid" viewbox="0 0 300 240" width="24" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id=":R3dtlqcmqn9:a" x1="84.75%" x2="58.254%" y1="111.399%" y2="64.584%"> <stop offset="0%" stop-color="#FB7655"> </stop> <stop offset="0%" stop-color="#FB7655"> </stop> <stop offset="41%" stop-color="#E42B1E"> </stop> <stop offset="99%" stop-color="#900"> </stop> <stop offset="100%" stop-color="#900"> </stop> </lineargradient> <lineargradient id=":R3dtlqcmqn9:b" x1="116.651%" x2="1.746%" y1="60.89%" y2="19.288%"> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="99%" stop-color="#911209"> </stop> <stop offset="100%" stop-color="#911209"> </stop> </lineargradient> <lineargradient id=":R3dtlqcmqn9:c" x1="75.774%" x2="38.978%" y1="219.327%" y2="7.829%"> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="99%" stop-color="#911209"> </stop> <stop offset="100%" stop-color="#911209"> </stop> </lineargradient> <lineargradient id=":R3dtlqcmqn9:d" x1="50.012%" x2="66.483%" y1="7.234%" y2="79.135%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="23%" stop-color="#E57252"> </stop> <stop offset="46%" stop-color="#DE3B20"> </stop> <stop offset="99%" stop-color="#A60003"> </stop> <stop offset="100%" stop-color="#A60003"> </stop> </lineargradient> <lineargradient id=":R3dtlqcmqn9:e" x1="46.174%" x2="49.932%" y1="16.348%" y2="83.047%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="23%" stop-color="#E4714E"> </stop> <stop offset="56%" stop-color="#BE1A0D"> </stop> <stop offset="99%" stop-color="#A80D00"> </stop> <stop offset="100%" stop-color="#A80D00"> </stop> </lineargradient> <lineargradient id=":R3dtlqcmqn9:f" x1="36.965%" x2="49.528%" y1="15.594%" y2="92.478%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="18%" stop-color="#E46342"> </stop> <stop offset="40%" stop-color="#C82410"> </stop> <stop offset="99%" stop-color="#A80D00"> </stop> <stop offset="100%" stop-color="#A80D00"> </stop> </lineargradient> <lineargradient id=":R3dtlqcmqn9:g" x1="13.609%" x2="85.764%" y1="58.346%" y2="-46.717%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="54%" stop-color="#C81F11"> </stop> <stop offset="99%" stop-color="#BF0905"> </stop> <stop offset="100%" stop-color="#BF0905"> </stop> </lineargradient> <lineargradient id=":R3dtlqcmqn9:h" x1="27.624%" x2="50.745%" y1="21.135%" y2="79.056%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="31%" stop-color="#DE4024"> </stop> <stop offset="99%" stop-color="#BF190B"> </stop> <stop offset="100%" stop-color="#BF190B"> </stop> </lineargradient> <lineargradient id=":R3dtlqcmqn9:i" x1="-20.667%" x2="104.242%" y1="122.282%" y2="-6.342%"> <stop offset="0%" stop-color="#BD0012"> </stop> <stop offset="0%" stop-color="#BD0012"> </stop> <stop offset="7%" stop-color="#FFF"> </stop> <stop offset="17%" stop-color="#FFF"> </stop> <stop offset="27%" stop-color="#C82F1C"> </stop> <stop offset="33%" stop-color="#820C01"> </stop> <stop offset="46%" stop-color="#A31601"> </stop> <stop offset="72%" stop-color="#B31301"> </stop> <stop offset="99%" stop-color="#E82609"> </stop> <stop offset="100%" stop-color="#E82609"> </stop> </lineargradient> <lineargradient id=":R3dtlqcmqn9:j" x1="58.792%" x2="11.964%" y1="65.205%" y2="50.128%"> <stop offset="0%" stop-color="#8C0C01"> </stop> <stop offset="0%" stop-color="#8C0C01"> </stop> <stop offset="54%" stop-color="#990C00"> </stop> <stop offset="99%" stop-color="#A80D0E"> </stop> <stop offset="100%" stop-color="#A80D0E"> </stop> </lineargradient> <lineargradient id=":R3dtlqcmqn9:k" x1="79.319%" x2="23.088%" y1="62.754%" y2="17.888%"> <stop offset="0%" stop-color="#7E110B"> </stop> <stop offset="0%" stop-color="#7E110B"> </stop> <stop offset="99%" stop-color="#9E0C00"> </stop> <stop offset="100%" stop-color="#9E0C00"> </stop> </lineargradient> <lineargradient id=":R3dtlqcmqn9:l" x1="92.88%" x2="59.841%" y1="74.122%" y2="39.704%"> <stop offset="0%" stop-color="#79130D"> </stop> <stop offset="0%" stop-color="#79130D"> </stop> <stop offset="99%" stop-color="#9E120B"> </stop> <stop offset="100%" stop-color="#9E120B"> </stop> </lineargradient> <lineargradient id=":R3dtlqcmqn9:o" x1="56.57%" x2="3.105%" y1="101.717%" y2="11.993%"> <stop offset="0%" stop-color="#8B2114"> </stop> <stop offset="0%" stop-color="#8B2114"> </stop> <stop offset="43%" stop-color="#9E100A"> </stop> <stop offset="99%" stop-color="#B3100C"> </stop> <stop offset="100%" stop-color="#B3100C"> </stop> </lineargradient> <lineargradient id=":R3dtlqcmqn9:p" x1="30.87%" x2="92.471%" y1="35.599%" y2="100.694%"> <stop offset="0%" stop-color="#B31000"> </stop> <stop offset="0%" stop-color="#B31000"> </stop> <stop offset="44%" stop-color="#910F08"> </stop> <stop offset="99%" stop-color="#791C12"> </stop> <stop offset="100%" stop-color="#791C12"> </stop> </lineargradient> <radialgradient cx="32.001%" cy="40.21%" fx="32.001%" fy="40.21%" id=":R3dtlqcmqn9:m" r="69.573%"> <stop offset="0%" stop-color="#A80D00"> </stop> <stop offset="0%" stop-color="#A80D00"> </stop> <stop offset="99%" stop-color="#7E0E08"> </stop> <stop offset="100%" stop-color="#7E0E08"> </stop> </radialgradient> <radialgradient cx="13.549%" cy="40.86%" fx="13.549%" fy="40.86%" id=":R3dtlqcmqn9:n" r="88.386%"> <stop offset="0%" stop-color="#A30C00"> </stop> <stop offset="0%" stop-color="#A30C00"> </stop> <stop offset="99%" stop-color="#800E08"> </stop> <stop offset="100%" stop-color="#800E08"> </stop> </radialgradient> </defs> <path d="M197.467 167.764l-145.52 86.41 188.422-12.787L254.88 51.393l-57.414 116.37z" fill="url(#:R3dtlqcmqn9:a)"> </path> <path d="M240.677 241.257L224.482 129.48l-44.113 58.25 60.308 53.528z" fill="url(#:R3dtlqcmqn9:b)"> </path> <path d="M240.896 241.257l-118.646-9.313-69.674 21.986 188.32-12.673z" fill="url(#:R3dtlqcmqn9:c)"> </path> <path d="M52.744 253.955l29.64-97.1L17.16 170.8l35.583 83.154z" fill="url(#:R3dtlqcmqn9:d)"> </path> <path d="M180.358 188.05L153.085 81.226l-78.047 73.16 105.32 33.666z" fill="url(#:R3dtlqcmqn9:e)"> </path> <path d="M248.693 82.73l-73.777-60.256-20.544 66.418 94.321-6.162z" fill="url(#:R3dtlqcmqn9:f)"> </path> <path d="M214.191.99L170.8 24.97 143.424.669l70.767.322z" fill="url(#:R3dtlqcmqn9:g)"> </path> <path d="M0 203.372l18.177-33.151-14.704-39.494L0 203.372z" fill="url(#:R3dtlqcmqn9:h)"> </path> <path d="M2.496 129.48l14.794 41.963 64.283-14.422 73.39-68.207 20.712-65.787L143.063 0 87.618 20.75c-17.469 16.248-51.366 48.396-52.588 49-1.21.618-22.384 40.639-32.534 59.73z" fill="#FFF"> </path> <path d="M54.442 54.094c37.86-37.538 86.667-59.716 105.397-40.818 18.72 18.898-1.132 64.823-38.992 102.349-37.86 37.525-86.062 60.925-104.78 42.027-18.73-18.885.515-66.032 38.375-103.558z" fill="url(#:R3dtlqcmqn9:i)"> </path> <path d="M52.744 253.916l29.408-97.409 97.665 31.376c-35.312 33.113-74.587 61.106-127.073 66.033z" fill="url(#:R3dtlqcmqn9:j)"> </path> <path d="M155.092 88.622l25.073 99.313c29.498-31.016 55.972-64.36 68.938-105.603l-94.01 6.29z" fill="url(#:R3dtlqcmqn9:k)"> </path> <path d="M248.847 82.833c10.035-30.282 12.35-73.725-34.966-81.791l-38.825 21.445 73.791 60.346z" fill="url(#:R3dtlqcmqn9:l)"> </path> <path d="M0 202.935c1.39 49.979 37.448 50.724 52.808 51.162l-35.48-82.86L0 202.935z" fill="#9E1209"> </path> <path d="M155.232 88.777c22.667 13.932 68.35 41.912 69.276 42.426 1.44.81 19.695-30.784 23.838-48.64l-93.114 6.214z" fill="url(#:R3dtlqcmqn9:m)"> </path> <path d="M82.113 156.507l39.313 75.848c23.246-12.607 41.45-27.967 58.121-44.42l-97.434-31.428z" fill="url(#:R3dtlqcmqn9:n)"> </path> <path d="M17.174 171.34l-5.57 66.328c10.51 14.357 24.97 15.605 40.136 14.486-10.973-27.311-32.894-81.92-34.566-80.814z" fill="url(#:R3dtlqcmqn9:o)"> </path> <path d="M174.826 22.654l78.1 10.96c-4.169-17.662-16.969-29.06-38.787-32.623l-39.313 21.663z" fill="url(#:R3dtlqcmqn9:p)"> </path> </svg> <span> Mongoid </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/drivers/rust/current/usage-examples/distinct/" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 30 30" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_5454_14623)"> <path d="M15.2561 3.08398C8.56014 3.08398 3.11035 8.53634 3.11035 15.2297C3.11035 21.9231 8.56271 27.3755 15.2561 27.3755C21.9495 27.3755 27.4019 21.9231 27.4019 15.2297C27.4019 8.53634 21.9495 3.08398 15.2561 3.08398ZM15.2381 4.16315C15.4458 4.16853 15.6432 4.25509 15.7881 4.40437C15.9331 4.55365 16.0142 4.75384 16.0141 4.96225C16.0141 5.17418 15.9299 5.37744 15.7801 5.5273C15.6302 5.67715 15.4269 5.76134 15.215 5.76134C15.0031 5.76134 14.7998 5.67715 14.65 5.5273C14.5001 5.37744 14.4159 5.17418 14.4159 4.96225C14.4159 4.85533 14.4373 4.7495 14.4789 4.65101C14.5205 4.55252 14.5814 4.46338 14.6581 4.38887C14.7347 4.31435 14.8256 4.25598 14.9252 4.21721C15.0249 4.17844 15.1313 4.16006 15.2381 4.16315ZM17.0676 5.47871C18.4704 5.74146 19.7992 6.30644 20.9617 7.13439C22.1242 7.96235 23.0926 9.03345 23.7995 10.2733L22.8565 12.4008C22.6947 12.7682 22.8617 13.1999 23.2265 13.3643L25.0406 14.1686C25.0968 14.7356 25.1037 15.3065 25.0611 15.8747H24.0513C23.9511 15.8747 23.91 15.9415 23.91 16.0391V16.5016C23.91 17.5911 23.2959 17.83 22.7563 17.8891C22.2424 17.9482 21.6746 17.6733 21.6026 17.3598C21.2994 15.6563 20.7958 15.294 19.9993 14.6645C20.9885 14.0375 22.0163 13.11 22.0163 11.8715C22.0163 10.5328 21.099 9.69002 20.4747 9.27634C19.5959 8.69822 18.6247 8.5826 18.3626 8.5826H7.93063C9.37312 6.97114 11.3066 5.88021 13.4318 5.47871L14.6626 6.76857C14.9401 7.05891 15.4 7.07176 15.6903 6.79169L17.0676 5.47871ZM5.71063 11.3936C5.91853 11.3996 6.11589 11.4864 6.26079 11.6356C6.40568 11.7849 6.48669 11.9847 6.4866 12.1927C6.4866 12.4046 6.40241 12.6079 6.25255 12.7577C6.10269 12.9076 5.89944 12.9918 5.6875 12.9918C5.47557 12.9918 5.27232 12.9076 5.12246 12.7577C4.9726 12.6079 4.88841 12.4046 4.88841 12.1927C4.88836 12.0858 4.90977 11.9799 4.95137 11.8814C4.99297 11.7829 5.0539 11.6938 5.13057 11.6193C5.20724 11.5448 5.29809 11.4864 5.39772 11.4476C5.49736 11.4089 5.60376 11.3905 5.71063 11.3936ZM24.7631 11.4295C24.971 11.4356 25.1683 11.5224 25.3132 11.6716C25.4581 11.8208 25.5391 12.0206 25.539 12.2286C25.539 12.4406 25.4548 12.6438 25.305 12.7937C25.1551 12.9435 24.9519 13.0277 24.7399 13.0277C24.528 13.0277 24.3247 12.9435 24.1749 12.7937C24.025 12.6438 23.9408 12.4406 23.9408 12.2286C23.9408 12.1217 23.9622 12.0159 24.0038 11.9174C24.0454 11.8189 24.1063 11.7298 24.183 11.6553C24.2597 11.5807 24.3505 11.5224 24.4502 11.4836C24.5498 11.4448 24.6562 11.4264 24.7631 11.4295ZM7.21632 11.558H8.60896V17.8377H5.79799C5.45083 16.6186 5.34264 15.3439 5.47938 14.0838L7.20091 13.3181C7.56834 13.1536 7.73535 12.7245 7.57091 12.3571L7.21632 11.558ZM13.0284 11.6248H16.3456C16.5177 11.6248 17.5558 11.8227 17.5558 12.6012C17.5558 13.2461 16.7592 13.4774 16.104 13.4774H13.0258L13.0284 11.6248ZM13.0284 16.1368H15.5696C15.8008 16.1368 16.8106 16.2036 17.1318 17.4934C17.232 17.8891 17.4556 19.179 17.6072 19.5927C17.7588 20.0552 18.3729 20.9802 19.0281 20.9802H23.1751C22.8972 21.3524 22.5933 21.7044 22.2656 22.0336L20.5774 21.6713C20.1843 21.5866 19.7963 21.8384 19.7115 22.2315L19.3107 24.102C18.0217 24.6859 16.622 24.9848 15.2069 24.9781C13.7919 24.9714 12.395 24.6595 11.1116 24.0635L10.7108 22.1929C10.626 21.7998 10.2406 21.548 9.84743 21.6328L8.19528 21.9874C7.88869 21.6711 7.6037 21.3346 7.34223 20.9802H15.3769C15.4668 20.9802 15.5285 20.9647 15.5285 20.88V18.0381C15.5285 17.9559 15.4668 17.9379 15.3769 17.9379H13.0258L13.0284 16.1368ZM9.3207 22.6452C9.5286 22.6512 9.72596 22.738 9.87085 22.8872C10.0157 23.0364 10.0968 23.2363 10.0967 23.4443C10.0967 23.6562 10.0125 23.8594 9.86262 24.0093C9.71276 24.1592 9.50951 24.2434 9.29757 24.2434C9.08564 24.2434 8.88239 24.1592 8.73253 24.0093C8.58267 23.8594 8.49848 23.6562 8.49848 23.4443C8.49843 23.3373 8.51984 23.2315 8.56144 23.133C8.60303 23.0345 8.66397 22.9454 8.74064 22.8709C8.81731 22.7964 8.90815 22.738 9.00779 22.6992C9.10743 22.6605 9.21383 22.6421 9.3207 22.6452ZM21.153 22.6811C21.3609 22.6872 21.5583 22.774 21.7031 22.9232C21.848 23.0724 21.929 23.2722 21.929 23.4802C21.929 23.6922 21.8448 23.8954 21.6949 24.0453C21.5451 24.1951 21.3418 24.2793 21.1299 24.2793C20.9179 24.2793 20.7147 24.1951 20.5648 24.0453C20.415 23.8954 20.3308 23.6922 20.3308 23.4802C20.3307 23.3733 20.3521 23.2675 20.3937 23.169C20.4353 23.0705 20.4963 22.9814 20.5729 22.9068C20.6496 22.8323 20.7404 22.774 20.8401 22.7352C20.9397 22.6964 21.0461 22.678 21.153 22.6811Z" fill="black"> </path> <path clip-rule="evenodd" d="M26.7232 15.2304C26.7232 18.2717 25.515 21.1885 23.3645 23.3391C21.2139 25.4896 18.2971 26.6978 15.2558 26.6978C12.2144 26.6978 9.29761 25.4896 7.14705 23.3391C4.99649 21.1885 3.78832 18.2717 3.78832 15.2304C3.78832 12.189 4.99649 9.27222 7.14705 7.12166C9.29761 4.9711 12.2144 3.76293 15.2558 3.76293C18.2971 3.76293 21.2139 4.9711 23.3645 7.12166C25.515 9.27222 26.7232 12.189 26.7232 15.2304ZM26.5073 14.1229L28.2957 15.2304L26.5073 16.3378L28.0439 17.7741L26.0757 18.5115L27.3039 20.2202L25.2252 20.5594L26.0988 22.4762L23.9944 22.4017L24.4775 24.4521L22.4271 23.969L22.5016 26.0734L20.5848 25.1998L20.2456 27.2785L18.5369 26.0503L17.7995 28.0185L16.3632 26.482L15.2558 28.2703L14.1483 26.482L12.712 28.0185L11.9746 26.0503L10.2659 27.2785L9.92672 25.1998L8.00992 26.0734L8.08443 23.969L6.03401 24.4521L6.51707 22.4017L4.4127 22.4762L5.28631 20.5594L3.20763 20.2202L4.43582 18.5115L2.46763 17.7741L4.00415 16.3378L2.21582 15.2304L4.00415 14.1229L2.46763 12.6866L4.43582 11.9492L3.20763 10.2405L5.28631 9.90133L4.4127 7.98453L6.51707 8.05904L6.03401 6.00862L8.08443 6.49168L8.00992 4.3873L9.92672 5.26092L10.2659 3.18223L11.9746 4.41043L12.712 2.44224L14.1483 3.97876L15.2558 2.19043L16.3632 3.97876L17.7995 2.44224L18.5369 4.41043L20.2456 3.18223L20.5848 5.26092L22.5016 4.3873L22.4271 6.49168L24.4775 6.00862L23.9944 8.05904L26.0988 7.98453L25.2252 9.90133L27.3039 10.2405L26.0757 11.9492L28.0439 12.6866L26.5073 14.1229Z" fill="black" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"> </path> </g> <defs> <clippath id="clip0_5454_14623"> <rect fill="black" height="30" width="30"> </rect> </clippath> </defs> </svg> <span> Rust </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://mongodb.github.io/mongo-java-driver/5.1/apidocs/mongo-scala-driver/org/mongodb/scala/MongoCollection.html#distinct[C](fieldName:String,filter:org.mongodb.scala.bson.conversions.Bson)(implicitct:scala.reflect.ClassTag[C]):org.mongodb.scala.DistinctObservable[C]" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 70 70" width="24" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id=":R3ltlqcmqn9:aaa" x1=".006%" x2="96.837%" y1="49.998%" y2="49.998%"> <stop offset="0%" stop-color="#CD413F"> </stop> <stop offset="75.091%" stop-color="#CD4543"> </stop> <stop offset="100%" stop-color="#D04543"> </stop> </lineargradient> </defs> <g fill="none" fill-rule="nonzero"> <path d="M13 39v5c0 .843 17.73 2.255 29.28 5 5.582-1.327 9.72-2.966 9.72-5v-5c0-2.034-4.138-3.673-9.72-5C30.73 36.745 13 38.157 13 39M13 20v5c0 .843 17.73 2.255 29.28 5 5.582-1.327 9.72-2.966 9.72-5v-5c0-2.034-4.138-3.673-9.72-5C30.73 17.745 13 19.157 13 20" fill="#731818"> </path> <g fill="url(#:R3ltlqcmqn9:aaa)" transform="translate(13)"> <path d="M0 29.53v14.766c0-1.232 39-3.692 39-9.844V19.686c0 6.152-39 8.612-39 9.844M0 9.843V24.61c0-1.231 39-3.691 39-9.843V0C39 6.152 0 8.612 0 9.843M0 49.216v14.766c0-1.231 39-3.691 39-9.843V39.373c0 6.151-39 8.612-39 9.843"> </path> </g> </g> </svg> <span> Scala </span> </a> </div> <button class="leafygreen-ui-ki2t97"> Show all <svg aria-label="Chevron Down Icon" class="" fill="none" height="16" role="img" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M1.636 5.364a1 1 0 0 0 0 1.414l4.95 4.95.707.707a1 1 0 0 0 1.414 0l.707-.707 4.95-4.95a1 1 0 0 0 0-1.414l-.707-.707a1 1 0 0 0-1.414 0L8 8.899 3.757 4.657a1 1 0 0 0-1.414 0l-.707.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </button> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.collection.distinct(field, query, options) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.collection.distinct" 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-method-db.collection.distinct"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Finds the distinct values for a specified field across a single collection or view and returns the results in an array. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This method is available in deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <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 command has limited support in M0, M2, and M5 clusters. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This method takes the following parameters: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> field </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The field for which to return distinct values. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> query </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> A query that specifies the documents from which to retrieve the distinct values. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> options </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. A document that specifies the options. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-distinct-method-options" target="_self"> <span> Options <!-- --> . </span> </a> </div> </div> </td> </tr> </tbody> </table> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Results must not be larger than the maximum <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/limits/#std-label-limit-bson-document-size"> BSON size </a> . If your results exceed the maximum BSON size, use the aggregation pipeline to retrieve distinct values using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> operator, as described in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#std-label-aggregation-group-distinct-values"> Retrieve Distinct Values with the Aggregation Pipeline <!-- --> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following diagram shows an example <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.distinct" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.distinct() </code> </span> </a> call. </p> <div class="figure css-5vkxs0" style="width:520px"> <img alt="Diagram of the annotated distinct operation." class="leafygreen-ui-1qnf57e" height="540" src="/docs/manual/images/distinct.bakedsvg.svg" style="--border-color:#C1C7C6" width="440"/> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-distinct-method-options"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Options <a class="headerlink leafygreen-ui-1kepx47" href="#options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="options"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ collation: &lt;document&gt; }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">collation</span>: &lt;<span class="lg-highlight-variable lg-highlight-language">document</span>&gt; <!-- -->}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> collation </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. </p> <p class="leafygreen-ui-1kp3ins"> Specifies the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> collation </a> to use for the operation. </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> Collation </a> allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks. </p> <p class="leafygreen-ui-1kp3ins"> The collation option has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collation: {\n locale: &lt;string&gt;,\n caseLevel: &lt;boolean&gt;,\n caseFirst: &lt;string&gt;,\n strength: &lt;int&gt;,\n numericOrdering: &lt;boolean&gt;,\n alternate: &lt;string&gt;,\n maxVariable: &lt;string&gt;,\n backwards: &lt;boolean&gt;\n}"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collation: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> locale: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> caseLevel: &lt;boolean&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> caseFirst: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> strength: &lt;int&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> numericOrdering: &lt;boolean&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> alternate: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> maxVariable: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> backwards: &lt;boolean&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> When specifying collation, the <code class="leafygreen-ui-1l06pbn"> locale </code> field is mandatory; all other collation fields are optional. For descriptions of the fields, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation-document-fields"> Collation Document <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If the collation is unspecified but the collection has a default collation (see <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> ), the operation uses the collation specified for the collection. </p> <p class="leafygreen-ui-1kp3ins"> If no collation is specified for the collection or for the operations, MongoDB uses the simple binary comparison used in prior versions for string comparisons. </p> <p class="leafygreen-ui-1kp3ins"> You cannot specify multiple collations for an operation. For example, you cannot specify different collations per field, or if performing a find with a sort, you cannot use one collation for the find and another for the sort. </p> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> 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/command/distinct/#mongodb-dbcommand-dbcmd.distinct"> <code class="leafygreen-ui-1l06pbn"> distinct </code> </a> command may return <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-orphaned-document"> orphaned documents <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> For <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-manual-timeseries-landing"> time series collections </a> , the <code class="leafygreen-ui-1l06pbn"> distinct </code> command can't make efficient use of indexes. Instead, use a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> aggregation to group documents by distinct values. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-limitations/#std-label-timeseries-limitation-distinct"> Time Series Limitations <!-- --> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-distinct-method-behavior-array"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Array Fields <a class="headerlink leafygreen-ui-1kepx47" href="#array-fields" 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="array-fields"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If the value of the specified <code class="leafygreen-ui-1l06pbn"> field </code> is an array, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.distinct" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.distinct() </code> </span> </a> considers each element of the array as a separate value. </p> <p class="leafygreen-ui-1kp3ins"> For instance, if a field has as its value <code class="leafygreen-ui-1l06pbn"> [ 1, [1], 1 ] </code> , then <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.distinct" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.distinct() </code> </span> </a> considers <code class="leafygreen-ui-1l06pbn"> 1 </code> , <code class="leafygreen-ui-1l06pbn"> [1] </code> , and <code class="leafygreen-ui-1l06pbn"> 1 </code> as separate values. </p> <p class="leafygreen-ui-1kp3ins"> For an example, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-distinct-method-array" target="_self"> <span> Return Distinct Values for an Array Field <!-- --> . </span> </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Index Use <a class="headerlink leafygreen-ui-1kepx47" href="#index-use" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="index-use"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When possible, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.distinct" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.distinct() </code> </span> </a> operations can use indexes. </p> <p class="leafygreen-ui-1kp3ins"> Indexes can also <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-optimization/#std-label-covered-queries"> cover </a> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.distinct" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.distinct() </code> </span> </a> operations. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-optimization/#std-label-covered-queries"> Covered Query </a> for more information on queries covered by indexes. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Transactions <a class="headerlink leafygreen-ui-1kepx47" href="#transactions" 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="transactions"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To perform a distinct operation within a transaction: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For unsharded collections, you can use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.distinct" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.distinct() </code> </span> </a> method/the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/distinct/#mongodb-dbcommand-dbcmd.distinct"> <code class="leafygreen-ui-1l06pbn"> distinct </code> </a> command as well as the aggregation pipeline with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> stage. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For sharded collections, you cannot use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.distinct" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.distinct() </code> </span> </a> method or the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/distinct/#mongodb-dbcommand-dbcmd.distinct"> <code class="leafygreen-ui-1l06pbn"> distinct </code> </a> command. </p> <p class="leafygreen-ui-1kp3ins"> To find the distinct values for a sharded collection, use the aggregation pipeline with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> stage instead. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions-operations/#std-label-transactions-operations-distinct"> Distinct Operation </a> for details. </p> </li> </ul> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> In most cases, a distributed transaction incurs a greater performance cost over single document writes, and the availability of distributed transactions should not be a replacement for effective schema design. For many scenarios, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/concepts/embedding-vs-references/#std-label-data-modeling-embedding"> denormalized data model (embedded documents and arrays) </a> will continue to be optimal for your data and use cases. That is, for many scenarios, modeling your data appropriately will minimize the need for distributed transactions. </p> <p class="leafygreen-ui-1kp3ins"> For additional transactions usage considerations (such as runtime limit and oplog size limit), see also <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions-production-consideration/#std-label-production-considerations"> Production Considerations <!-- --> . </a> </p> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Client Disconnection <a class="headerlink leafygreen-ui-1kepx47" href="#client-disconnection" 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="client-disconnection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 4.2, if the client that issued <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.distinct" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.distinct() </code> </span> </a> disconnects before the operation completes, MongoDB marks <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.distinct" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.distinct() </code> </span> </a> for termination using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/killOp/#mongodb-dbcommand-dbcmd.killOp"> <code class="leafygreen-ui-1l06pbn"> killOp </code> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Replica Set Member State Restriction <a class="headerlink leafygreen-ui-1kepx47" href="#replica-set-member-state-restriction" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="replica-set-member-state-restriction"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To run on a replica set member, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/distinct/#mongodb-dbcommand-dbcmd.distinct"> <code class="leafygreen-ui-1l06pbn"> distinct </code> </a> operations require the member to be in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-states/#mongodb-replstate-replstate.PRIMARY"> <code class="leafygreen-ui-1l06pbn"> PRIMARY </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-states/#mongodb-replstate-replstate.SECONDARY"> <code class="leafygreen-ui-1l06pbn"> SECONDARY </code> </a> state. If the member is in another state, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-states/#mongodb-replstate-replstate.STARTUP2"> <code class="leafygreen-ui-1l06pbn"> STARTUP2 </code> </a> , the operation errors. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Query Settings <a class="headerlink leafygreen-ui-1kepx47" href="#query-settings" 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="query-settings"> </div> </a> </h3> <div> <p> <em> New <!-- --> in version <!-- --> 8.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> You can use query settings to set index hints, set <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/operation-rejection-filters/#std-label-operation-rejection-filters"> operation rejection filters </a> , and other fields. The settings apply to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/queryStats/#std-label-queryStats-queryShape"> query shape </a> on the entire cluster. The cluster retains the settings after shutdown. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-query-optimizer"> query optimizer </a> uses the query settings as an additional input during query planning, which affects the plan selected to run the query. You can also use query settings to block a query shape. </p> <p class="leafygreen-ui-1kp3ins"> To add query settings and explore examples, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setQuerySettings/#mongodb-dbcommand-dbcmd.setQuerySettings"> <code class="leafygreen-ui-1l06pbn"> setQuerySettings </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> You can add query settings for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/find/#mongodb-dbcommand-dbcmd.find"> <code class="leafygreen-ui-1l06pbn"> find </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/distinct/#mongodb-dbcommand-dbcmd.distinct"> <code class="leafygreen-ui-1l06pbn"> distinct </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/aggregate/#mongodb-dbcommand-dbcmd.aggregate"> <code class="leafygreen-ui-1l06pbn"> aggregate </code> </a> commands. </p> <p class="leafygreen-ui-1kp3ins"> Query settings have more functionality and are preferred over deprecated <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-plans/#std-label-index-filters"> index filters <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To remove query settings, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/removeQuerySettings/#mongodb-dbcommand-dbcmd.removeQuerySettings"> <code class="leafygreen-ui-1l06pbn"> removeQuerySettings </code> </a> . To obtain the query settings, use a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/querySettings/#mongodb-pipeline-pipe.-querySettings"> <code class="leafygreen-ui-1l06pbn"> $querySettings </code> </a> stage in an aggregation pipeline. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The examples use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection that contains the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\": 1, \"dept\": \"A\", \"item\": { \"sku\": \"111\", \"color\": \"red\" }, \"sizes\": [ \"S\", \"M\" ] }\n{ \"_id\": 2, \"dept\": \"A\", \"item\": { \"sku\": \"111\", \"color\": \"blue\" }, \"sizes\": [ \"M\", \"L\" ] }\n{ \"_id\": 3, \"dept\": \"B\", \"item\": { \"sku\": \"222\", \"color\": \"blue\" }, \"sizes\": \"S\" }\n{ \"_id\": 4, \"dept\": \"A\", \"item\": { \"sku\": \"333\", \"color\": \"black\" }, \"sizes\": [ \"S\" ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"dept"</span>: <span class="lg-highlight-string">"A"</span>, <span class="lg-highlight-string">"item"</span>: <!-- -->{ <span class="lg-highlight-string">"sku"</span>: <span class="lg-highlight-string">"111"</span>, <span class="lg-highlight-string">"color"</span>: <span class="lg-highlight-string">"red"</span> }<!-- -->, <span class="lg-highlight-string">"sizes"</span>: <!-- -->[ <span class="lg-highlight-string">"S"</span>, <span class="lg-highlight-string">"M"</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"dept"</span>: <span class="lg-highlight-string">"A"</span>, <span class="lg-highlight-string">"item"</span>: <!-- -->{ <span class="lg-highlight-string">"sku"</span>: <span class="lg-highlight-string">"111"</span>, <span class="lg-highlight-string">"color"</span>: <span class="lg-highlight-string">"blue"</span> }<!-- -->, <span class="lg-highlight-string">"sizes"</span>: <!-- -->[ <span class="lg-highlight-string">"M"</span>, <span class="lg-highlight-string">"L"</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"dept"</span>: <span class="lg-highlight-string">"B"</span>, <span class="lg-highlight-string">"item"</span>: <!-- -->{ <span class="lg-highlight-string">"sku"</span>: <span class="lg-highlight-string">"222"</span>, <span class="lg-highlight-string">"color"</span>: <span class="lg-highlight-string">"blue"</span> }<!-- -->, <span class="lg-highlight-string">"sizes"</span>: <span class="lg-highlight-string">"S"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"dept"</span>: <span class="lg-highlight-string">"A"</span>, <span class="lg-highlight-string">"item"</span>: <!-- -->{ <span class="lg-highlight-string">"sku"</span>: <span class="lg-highlight-string">"333"</span>, <span class="lg-highlight-string">"color"</span>: <span class="lg-highlight-string">"black"</span> }<!-- -->, <span class="lg-highlight-string">"sizes"</span>: <!-- -->[ <span class="lg-highlight-string">"S"</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> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Return Distinct Values for a Field <a class="headerlink leafygreen-ui-1kepx47" href="#return-distinct-values-for-a-field" 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="return-distinct-values-for-a-field"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example returns the distinct values for the field <code class="leafygreen-ui-1l06pbn"> dept </code> from all documents in the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.distinct( \"dept\" )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">distinct</span>( <span class="lg-highlight-string">"dept"</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 method returns the following array of distinct <code class="leafygreen-ui-1l06pbn"> dept </code> values: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[ \"A\", \"B\" ]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ <span class="lg-highlight-string">"A"</span>, <span class="lg-highlight-string">"B"</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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Return Distinct Values for an Embedded Field <a class="headerlink leafygreen-ui-1kepx47" href="#return-distinct-values-for-an-embedded-field" 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="return-distinct-values-for-an-embedded-field"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example returns the distinct values for the field <code class="leafygreen-ui-1l06pbn"> sku </code> , embedded in the <code class="leafygreen-ui-1l06pbn"> item </code> field, from all documents in the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.distinct( \"item.sku\" )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">distinct</span>( <span class="lg-highlight-string">"item.sku"</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 method returns the following array of distinct <code class="leafygreen-ui-1l06pbn"> sku </code> values: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[ \"111\", \"222\", \"333\" ]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ <span class="lg-highlight-string">"111"</span>, <span class="lg-highlight-string">"222"</span>, <span class="lg-highlight-string">"333"</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-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/document/#std-label-document-dot-notation"> Dot Notation </a> for information on accessing fields within embedded documents </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-distinct-method-array"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Return Distinct Values for an Array Field <a class="headerlink leafygreen-ui-1kepx47" href="#return-distinct-values-for-an-array-field" 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="return-distinct-values-for-an-array-field"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example returns the distinct values for the field <code class="leafygreen-ui-1l06pbn"> sizes </code> from all documents in the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.distinct( \"sizes\" )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">distinct</span>( <span class="lg-highlight-string">"sizes"</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 method returns the following array of distinct <code class="leafygreen-ui-1l06pbn"> sizes </code> values: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[ \"M\", \"S\", \"L\" ]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ <span class="lg-highlight-string">"M"</span>, <span class="lg-highlight-string">"S"</span>, <span class="lg-highlight-string">"L"</span> ]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For information on <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.distinct" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> distinct() </code> </span> </a> and array fields, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-distinct-method-behavior-array" target="_self"> <span> Behavior </span> </a> section. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify Query with <code class="leafygreen-ui-1l06pbn"> distinct </code> <a class="headerlink leafygreen-ui-1kepx47" href="#specify-query-with-distinct" 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="specify-query-with-distinct"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example returns the distinct values for the field <code class="leafygreen-ui-1l06pbn"> sku </code> , embedded in the <code class="leafygreen-ui-1l06pbn"> item </code> field, from the documents whose <code class="leafygreen-ui-1l06pbn"> dept </code> is equal to <code class="leafygreen-ui-1l06pbn"> "A" </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.distinct( \"item.sku\", { dept: \"A\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">distinct</span>( <span class="lg-highlight-string">"item.sku"</span>, <!-- -->{ <span class="lg-highlight-attr">dept</span>: <span class="lg-highlight-string">"A"</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 method returns the following array of distinct <code class="leafygreen-ui-1l06pbn"> sku </code> values: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[ \"111\", \"333\" ]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ <span class="lg-highlight-string">"111"</span>, <span class="lg-highlight-string">"333"</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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify a Collation <a class="headerlink leafygreen-ui-1kepx47" href="#specify-a-collation" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="specify-a-collation"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> Collation </a> allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks. </p> <p class="leafygreen-ui-1kp3ins"> A collection <code class="leafygreen-ui-1l06pbn"> myColl </code> has the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ _id: 1, category: \"café\", status: \"A\" }\n{ _id: 2, category: \"cafe\", status: \"a\" }\n{ _id: 3, category: \"cafE\", status: \"a\" }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"café"</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"A"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"a"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafE"</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"a"</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following aggregation operation includes the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> Collation </a> option: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.distinct( \"category\", {}, { collation: { locale: \"fr\", strength: 1 } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">distinct</span>( <span class="lg-highlight-string">"category"</span>, <!-- -->{<!-- -->}<!-- -->, <!-- -->{ <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span>, <span class="lg-highlight-attr">strength</span>: <span class="lg-highlight-number">1</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For descriptions on the collation fields, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation-document-fields"> Collation Document <!-- --> . </a> </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/administration/sharded-cluster-administration/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Sharded Cluster Administration <a class="headerlink leafygreen-ui-1kepx47" href="#sharded-cluster-administration" 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="sharded-cluster-administration"> </div> </a> </h1> <dl> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/view-sharded-cluster-configuration/"> View Cluster Configuration </a> </dt> <dd class="css-1ufxuu7"> View status information about the cluster's databases, shards, and chunks. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/add-shards-to-shard-cluster/"> Add Shards to a Cluster </a> </dt> <dd class="css-1ufxuu7"> Add a shard to add capacity to a sharded cluster. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/add-member-to-shard/"> Add a Member to a Shard </a> </dt> <dd class="css-1ufxuu7"> Add a member to a shard in a sharded cluster. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/remove-shards-from-cluster/"> Remove Shards from a Sharded Cluster </a> </dt> <dd class="css-1ufxuu7"> Migrate a single shard's data and remove the shard. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/unshard-collection/"> Unshard a Collection </a> </dt> <dd class="css-1ufxuu7"> Manually unshard a sharded collection. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/clear-jumbo-flag/"> Clear <code class="leafygreen-ui-1l06pbn"> jumbo </code> Flag </a> </dt> <dd class="css-1ufxuu7"> Manually clear <code class="leafygreen-ui-1l06pbn"> jumbo </code> flag from a chunk. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/drop-a-hashed-shard-key-index/"> Drop a Hashed Shard Key Index </a> </dt> <dd class="css-1ufxuu7"> Drop a Hashed Shard Key Index. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/config-shard/"> Config Shard </a> </dt> <dd class="css-1ufxuu7"> You can configure a config server to store both application data <em> and </em> the usual sharded cluster metadata. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/start-a-sharded-cluster-with-config-shard/"> Start a Sharded Cluster with a Config Shard </a> </dt> <dd class="css-1ufxuu7"> Start a Sharded Cluster with a Config Shard. </dd> </dl> </section>
https://www.mongodb.com/docs/manual/reference/method/Bulk.find.collation/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Bulk.find.collation() <a class="headerlink leafygreen-ui-1kepx47" href="#bulk.find.collation--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="bulk.find.collation--"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#description" target="_self"> <span> Description </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Description <a class="headerlink leafygreen-ui-1kepx47" href="#description" 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="description"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> Bulk.find.collation(&lt;document&gt;) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-Bulk.find.collation" 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-method-Bulk.find.collation"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> collation </a> for the bulk writes. Append to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find/#mongodb-method-Bulk.find"> <code class="leafygreen-ui-1l06pbn"> Bulk.find() </code> </a> method to specify <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> collation </a> for the find operation. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-Bulk.find.collation" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> Bulk.find.collation() </code> </span> </a> accepts the following collation document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n locale: &lt;string&gt;,\n caseLevel: &lt;boolean&gt;,\n caseFirst: &lt;string&gt;,\n strength: &lt;int&gt;,\n numericOrdering: &lt;boolean&gt;,\n alternate: &lt;string&gt;,\n maxVariable: &lt;string&gt;,\n backwards: &lt;boolean&gt;\n}"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> locale: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> caseLevel: &lt;boolean&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> caseFirst: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> strength: &lt;int&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> numericOrdering: &lt;boolean&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> alternate: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> maxVariable: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> backwards: &lt;boolean&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> When specifying collation, the <code class="leafygreen-ui-1l06pbn"> locale </code> field is mandatory; all other collation fields are optional. For descriptions of the fields, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation-document-fields"> Collation Document <!-- --> . </a> </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> locale </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> The ICU locale. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation-locales-defaults/#std-label-collation-languages-locales"> Supported Languages and Locales </a> for a list of supported locales. </p> <p class="leafygreen-ui-1kp3ins"> To specify simple binary comparison, specify <code class="leafygreen-ui-1l06pbn"> locale </code> value of <code class="leafygreen-ui-1l06pbn"> "simple" </code> . </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> strength </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The level of comparison to perform. Corresponds to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://unicode-org.github.io/icu/userguide/collation/concepts.html#comparison-levels" rel="noopener noreferrer"> <span> ICU Comparison Levels </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> . Possible values are: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:10%"/> <col style="width:90%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 1 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Primary level of comparison. Collation performs comparisons of the base characters only, ignoring other differences such as diacritics and case. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 2 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Secondary level of comparison. Collation performs comparisons up to secondary differences, such as diacritics. That is, collation performs comparisons of base characters (primary differences) and diacritics (secondary differences). Differences between base characters takes precedence over secondary differences. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 3 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Tertiary level of comparison. Collation performs comparisons up to tertiary differences, such as case and letter variants. That is, collation performs comparisons of base characters (primary differences), diacritics (secondary differences), and case and variants (tertiary differences). Differences between base characters takes precedence over secondary differences, which takes precedence over tertiary differences. </p> <p class="leafygreen-ui-1kp3ins"> This is the default level. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 4 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Quaternary Level. Limited for specific use case to consider punctuation when levels 1-3 ignore punctuation or for processing Japanese text. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 5 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Identical Level. Limited for specific use case of tie breaker. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://unicode-org.github.io/icu/userguide/collation/concepts.html#comparison-levels" rel="noopener noreferrer"> <span> ICU Collation: Comparison Levels </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> for details. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> caseLevel </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Flag that determines whether to include case comparison at <code class="leafygreen-ui-1l06pbn"> strength </code> level <code class="leafygreen-ui-1l06pbn"> 1 </code> or <code class="leafygreen-ui-1l06pbn"> 2 </code> . </p> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> true </code> , include case comparison; i.e. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When used with <code class="leafygreen-ui-1l06pbn"> strength:1 </code> , collation compares base characters and case. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When used with <code class="leafygreen-ui-1l06pbn"> strength:2 </code> , collation compares base characters, diacritics (and possible other secondary differences) and case. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> false </code> , do not include case comparison at level <code class="leafygreen-ui-1l06pbn"> 1 </code> or <code class="leafygreen-ui-1l06pbn"> 2 </code> . The default is <code class="leafygreen-ui-1l06pbn"> false </code> . </p> <p class="leafygreen-ui-1kp3ins"> For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://unicode-org.github.io/icu/userguide/collation/concepts.html#caselevel" rel="noopener noreferrer"> <span> ICU Collation: Case Level </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> . </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> caseFirst </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. A field that determines sort order of case differences during tertiary level comparisons. </p> <p class="leafygreen-ui-1kp3ins"> Possible values are: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:10%"/> <col style="width:90%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> "upper" </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Uppercase sorts before lowercase. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> "lower" </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Lowercase sorts before uppercase. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> "off" </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Default value. Similar to <code class="leafygreen-ui-1l06pbn"> "lower" </code> with slight differences. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://unicode-org.github.io/icu/userguide/strings/properties.html#customization" rel="noopener noreferrer"> <span> https://unicode-org.github.io/icu/userguide/strings/properties.html#customization </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> for details of differences. </div> </div> </td> </tr> </tbody> </table> </div> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> numericOrdering </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Flag that determines whether to compare numeric strings as numbers or as strings. </p> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> true </code> , compare as numbers; i.e. <code class="leafygreen-ui-1l06pbn"> "10" </code> is greater than <code class="leafygreen-ui-1l06pbn"> "2" </code> . </p> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> false </code> , compare as strings; i.e. <code class="leafygreen-ui-1l06pbn"> "10" </code> is less than <code class="leafygreen-ui-1l06pbn"> "2" </code> . </p> <p class="leafygreen-ui-1kp3ins"> Default is <code class="leafygreen-ui-1l06pbn"> false </code> . </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> alternate </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Field that determines whether collation should consider whitespace and punctuation as base characters for purposes of comparison. </p> <p class="leafygreen-ui-1kp3ins"> Possible values are: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:10%"/> <col style="width:90%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> "non-ignorable" </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Whitespace and punctuation are considered base characters. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> "shifted" </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Whitespace and punctuation are not considered base characters and are only distinguished at strength levels greater than 3. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://unicode-org.github.io/icu/userguide/collation/concepts.html#comparison-levels" rel="noopener noreferrer"> <span> ICU Collation: Comparison Levels </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> for more information. </p> <p class="leafygreen-ui-1kp3ins"> Default is <code class="leafygreen-ui-1l06pbn"> "non-ignorable" </code> . </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> maxVariable </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Field that determines up to which characters are considered ignorable when <code class="leafygreen-ui-1l06pbn"> alternate: "shifted" </code> . Has no effect if <code class="leafygreen-ui-1l06pbn"> alternate: "non-ignorable" </code> </p> <p class="leafygreen-ui-1kp3ins"> Possible values are: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:10%"/> <col style="width:90%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> "punct" </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Both whitespaces and punctuation are "ignorable", i.e. not considered base characters. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> "space" </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Whitespace are "ignorable", i.e. not considered base characters. </div> </div> </td> </tr> </tbody> </table> </div> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> backwards </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Flag that determines whether strings with diacritics sort from back of the string, such as with some French dictionary ordering. </p> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> true </code> , compare from back to front. </p> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> false </code> , compare from front to back. </p> <p class="leafygreen-ui-1kp3ins"> The default value is <code class="leafygreen-ui-1l06pbn"> false </code> . </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> normalization </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Flag that determines whether to check if text require normalization and to perform normalization. Generally, majority of text does not require this normalization processing. </p> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> true </code> , check if fully normalized and perform normalization to compare text. </p> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> false </code> , does not check. </p> <p class="leafygreen-ui-1kp3ins"> The default value is <code class="leafygreen-ui-1l06pbn"> false </code> . </p> <p class="leafygreen-ui-1kp3ins"> See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://unicode-org.github.io/icu/userguide/collation/concepts.html#normalization" rel="noopener noreferrer"> <span> https://unicode-org.github.io/icu/userguide/collation/concepts.html#normalization </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> for details. </p> </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example initializes a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> operations builder for the <code class="leafygreen-ui-1l06pbn"> myColl </code> collection and specifies a collation for the find filter. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var bulk = db.myColl.initializeUnorderedBulkOp();\nbulk.find( { category: \"cafe\" } ).collation({ locale: \"fr\", strength: 1 }).update( { $set: { status: \"I\", points: \"0\" } } );\nbulk.execute();","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> bulk <!-- -->= <!-- -->db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">initializeUnorderedBulkOp</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bulk.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> } ).<span class="lg-highlight-title lg-highlight-function">collation</span>(<!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span>, <span class="lg-highlight-attr">strength</span>: <span class="lg-highlight-number">1</span> }).<span class="lg-highlight-title lg-highlight-function">update</span>( <!-- -->{ <span class="lg-highlight-attr">$set</span>: <!-- -->{ <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"I"</span>, <span class="lg-highlight-attr">points</span>: <span class="lg-highlight-string">"0"</span> } } )<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bulk.<span class="lg-highlight-title lg-highlight-function">execute</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-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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.initializeUnorderedBulkOp/#mongodb-method-db.collection.initializeUnorderedBulkOp"> <code class="leafygreen-ui-1l06pbn"> db.collection.initializeUnorderedBulkOp() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.initializeOrderedBulkOp/#mongodb-method-db.collection.initializeOrderedBulkOp"> <code class="leafygreen-ui-1l06pbn"> db.collection.initializeOrderedBulkOp() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find/#mongodb-method-Bulk.find"> <code class="leafygreen-ui-1l06pbn"> Bulk.find() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.updateOne/#mongodb-method-Bulk.find.updateOne"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.updateOne() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.execute/#mongodb-method-Bulk.execute"> <code class="leafygreen-ui-1l06pbn"> Bulk.execute() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#std-label-bulk-methods"> All Bulk Methods </a> </p> </li> </ul> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/moveRange/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> moveRange <a class="headerlink leafygreen-ui-1kepx47" href="#moverange" 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="moverange"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#command-fields" target="_self"> <span> Command Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#considerations" target="_self"> <span> Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> moveRange </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.moveRange" 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-dbcommand-dbcmd.moveRange"> </div> </a> </dt> <dd> <div> <p> <em> New <!-- --> in version <!-- --> 6.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Moves <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-range"> ranges </a> between <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard"> shards </a> . Run the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.moveRange" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> moveRange </code> </span> </a> command with a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance while using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-admin-database"> admin database <!-- --> . </a> </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand(\n {\n moveRange: &lt;namespace&gt;,\n toShard: &lt;id&gt;,\n min: &lt;min&gt;, // conditional\n max: &lt;max&gt;, // conditional\n forceJumbo: &lt;bool&gt;, // optional\n waitForDelete: &lt;bool&gt;, // optional\n writeConcern: &lt;write&gt;, // optional\n secondaryThrottle: &lt;bool&gt; // optional\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">moveRange</span>: &lt;<!-- -->namespace<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">toShard</span>: <!-- -->&lt;ID of the recipient shard&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> min: &lt;min key of the range to move&gt;, // conditional</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> max: &lt;max key of the range to move&gt;, // conditional</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> forceJumbo: &lt;bool&gt;, // optional</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> waitForDelete: &lt;bool&gt;, // optional</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> writeConcern: &lt;write concern&gt;, // optional</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> secondaryThrottle: &lt;bool&gt; // optional</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Command Fields <a class="headerlink leafygreen-ui-1kepx47" href="#command-fields" 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="command-fields"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command takes the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> toShard </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ID of the recipient shard. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> min </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> key </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Minimum key of the range to move. Required if you don't specify <code class="leafygreen-ui-1l06pbn"> max </code> . </p> <p class="leafygreen-ui-1kp3ins"> If you do not specify <code class="leafygreen-ui-1l06pbn"> min </code> , given a chunk <code class="leafygreen-ui-1l06pbn"> C </code> where <code class="leafygreen-ui-1l06pbn"> max </code> is either the exclusive upper bound of <code class="leafygreen-ui-1l06pbn"> C </code> or <code class="leafygreen-ui-1l06pbn"> C </code> includes the shard key <code class="leafygreen-ui-1l06pbn"> max </code> , <code class="leafygreen-ui-1l06pbn"> min </code> is determined in the following way: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the data size of the range between <code class="leafygreen-ui-1l06pbn"> min(C) </code> and <code class="leafygreen-ui-1l06pbn"> max </code> is less than the per-collection chunk size or the default chunk size, the chunk's <code class="leafygreen-ui-1l06pbn"> min </code> value is selected as <code class="leafygreen-ui-1l06pbn"> min </code> = <code class="leafygreen-ui-1l06pbn"> min(C) </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Otherwise, key <code class="leafygreen-ui-1l06pbn"> min </code> &gt; <code class="leafygreen-ui-1l06pbn"> min(C) </code> where <code class="leafygreen-ui-1l06pbn"> min </code> depends on the configured chunk size. </p> </li> </ul> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> max </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> key </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Maximum key of the range to move. Required if you don't specify <code class="leafygreen-ui-1l06pbn"> min </code> . </p> <p class="leafygreen-ui-1kp3ins"> If you do not specify <code class="leafygreen-ui-1l06pbn"> max </code> , given a chunk <code class="leafygreen-ui-1l06pbn"> C </code> including the shard key <code class="leafygreen-ui-1l06pbn"> min </code> , <code class="leafygreen-ui-1l06pbn"> max </code> is determined in the following way: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the data size of the range between <code class="leafygreen-ui-1l06pbn"> min </code> and <code class="leafygreen-ui-1l06pbn"> max(C) </code> is less than the per-collection chunk size or the default chunk size, the chunk's max is selected as <code class="leafygreen-ui-1l06pbn"> max </code> = <code class="leafygreen-ui-1l06pbn"> max(C) </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Otherwise, key <code class="leafygreen-ui-1l06pbn"> max </code> &lt; <code class="leafygreen-ui-1l06pbn"> max(C) </code> where <code class="leafygreen-ui-1l06pbn"> max </code> depends on the configured chunk size. </p> </li> </ul> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-moverange-forceJumbo" target="_self"> <span> forceJumbo </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-moverange-forceJumbo"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. </p> <p class="leafygreen-ui-1kp3ins"> Flag that determines if the command can move a range that is <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-balancer-administration/#std-label-migration-chunk-size-limit"> too large to migrate </a> . The range may or may not be labeled as <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-data-partitioning/#std-label-jumbo-chunk"> jumbo <!-- --> . </a> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> true </code> , the command can move the range. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> false </code> , the command cannot move the range. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The default is <code class="leafygreen-ui-1l06pbn"> false </code> . </p> <p class="leafygreen-ui-1kp3ins"> <strong class="css-4dei7l"> WARNING: </strong> </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> moveRange </code> command with <code class="leafygreen-ui-1l06pbn"> forceJumbo=true </code> blocks read and write operations on the collection. </p> <p class="leafygreen-ui-1kp3ins"> This option causes the shard to migrate chunks even when they are larger than the configured chunk size. The collection remains unavailable for the duration of the migration. </p> <p class="leafygreen-ui-1kp3ins"> To migrate these large chunks without this long blocking period, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-sharded-cluster-balancer/#std-label-balance-chunks-that-exceed-size-limit"> Balance Ranges that Exceed Size Limit </a> instead. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> writeConcern </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. </p> <p class="leafygreen-ui-1kp3ins"> Document with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern"> write concern <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The default is <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> w: majority </code> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> secondaryThrottle </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> true </code> , each document move during chunk migration propagates to at least one secondary before the balancer proceeds with the next document. This is equivalent to a write concern of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-number-"> <code class="leafygreen-ui-1l06pbn"> { w: 2 } </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Use the <code class="leafygreen-ui-1l06pbn"> writeConcern </code> option to specify a different write concern. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> false </code> , the balancer does not wait for replication to a secondary and instead continues with the next document. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For more information, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-sharded-cluster-balancer/#std-label-sharded-cluster-config-secondary-throttle"> Secondary Throttle <!-- --> . </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-data-partitioning/#std-label-sharding-chunk-migration"> range migration </a> section describes how ranges move between shards on MongoDB. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#considerations" 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="considerations"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Only use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.moveRange" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> moveRange </code> </span> </a> in scenarios like: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> an initial ingestion of data </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> a large bulk import operation </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Allow the balancer to create and balance ranges in sharded clusters in most cases. </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/tutorial/create-chunks-in-sharded-cluster/#std-label-create-chunks-in-a-sharded-cluster"> Create Ranges in a Sharded Cluster </a> </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following examples use a collection with: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Shard key <code class="leafygreen-ui-1l06pbn"> x </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Configured chunk size of 128MB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A chunk with boundaries: <code class="leafygreen-ui-1l06pbn"> [x: 0, x: 100) </code> </p> </li> </ul> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify both <code class="leafygreen-ui-1l06pbn"> min </code> and <code class="leafygreen-ui-1l06pbn"> max </code> <a class="headerlink leafygreen-ui-1kepx47" href="#specify-both-min-and-max" 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="specify-both-min-and-max"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following table lists the results of setting <code class="leafygreen-ui-1l06pbn"> min </code> and <code class="leafygreen-ui-1l06pbn"> max </code> to various values: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> <code class="leafygreen-ui-1l06pbn"> min </code> </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> <code class="leafygreen-ui-1l06pbn"> max </code> </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Result </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 0 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 100 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Moves all the documents in the range to the recipient shard. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 10 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 30 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Creates three sub-ranges: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 0, x: 10) </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 10, x: 30) </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 30, x: 100) </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Moves all the documents in <code class="leafygreen-ui-1l06pbn"> [x: 10, x: 30) </code> to the recipient shard. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 0 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 20 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Creates two sub-ranges: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 0, x: 20) </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 20, x: 100) </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Moves all the documents in <code class="leafygreen-ui-1l06pbn"> [x: 0, x: 20) </code> to the recipient shard. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 40 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 100 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Creates two sub-ranges: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 0, x: 40) </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 40, x: 100) </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Moves all the documents in <code class="leafygreen-ui-1l06pbn"> [x: 40, x: 100) </code> to the recipient shard. </p> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify <code class="leafygreen-ui-1l06pbn"> min </code> but not <code class="leafygreen-ui-1l06pbn"> max </code> <a class="headerlink leafygreen-ui-1kepx47" href="#specify-min-but-not-max" 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="specify-min-but-not-max"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following table lists the results of setting <code class="leafygreen-ui-1l06pbn"> min </code> to various values: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> <code class="leafygreen-ui-1l06pbn"> min </code> </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Amount of Data in Key Range </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Result </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 0 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Less than 128 MB contained between keys <code class="leafygreen-ui-1l06pbn"> x: 0 </code> and <code class="leafygreen-ui-1l06pbn"> x: 100 </code> . </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Moves all the documents in the range to the recipient shard. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 10 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Less than 128 MB contained between keys <code class="leafygreen-ui-1l06pbn"> x: 0 </code> and <code class="leafygreen-ui-1l06pbn"> x: 100 </code> . </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Creates two sub-ranges: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 0, x: 10) </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x : 10, x: 100) </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Moves all documents in <code class="leafygreen-ui-1l06pbn"> [x: 10, x: 100) </code> to the recipient shard. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 10 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 128 MB contained between keys <code class="leafygreen-ui-1l06pbn"> x: 10 </code> and <code class="leafygreen-ui-1l06pbn"> x: 30 </code> . </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Creates three sub-ranges: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 0, x: 10) </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 10, x: 30) </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 30, x: 100) </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Moves all documents in <code class="leafygreen-ui-1l06pbn"> [x: 10, x: 30) </code> to the recipient shard. </p> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify <code class="leafygreen-ui-1l06pbn"> max </code> but not <code class="leafygreen-ui-1l06pbn"> min </code> <a class="headerlink leafygreen-ui-1kepx47" href="#specify-max-but-not-min" 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="specify-max-but-not-min"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following table lists the results of setting <code class="leafygreen-ui-1l06pbn"> max </code> to various values: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> <code class="leafygreen-ui-1l06pbn"> max </code> </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Amount of Data in Key Range </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Result </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 100 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Less than 128 MB contained between keys <code class="leafygreen-ui-1l06pbn"> x: 0 </code> and <code class="leafygreen-ui-1l06pbn"> x: 100 </code> . </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Moves all the documents in the range to the recipient shard. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 10 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Less than 128 MB contained between keys <code class="leafygreen-ui-1l06pbn"> x: 0 </code> and <code class="leafygreen-ui-1l06pbn"> x: 100 </code> . </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Creates two sub-ranges: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 0, x: 10) </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x : 10, x: 100) </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Moves all documents in <code class="leafygreen-ui-1l06pbn"> [x: 0, x: 10) </code> to the recipient shard. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 30 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 128 MB contained between keys <code class="leafygreen-ui-1l06pbn"> x: 10 </code> and <code class="leafygreen-ui-1l06pbn"> x: 30 </code> . </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Creates three sub-ranges: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 0, x: 10) </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 10, x: 30) </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> [x: 30, x: 100) </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Moves all documents in <code class="leafygreen-ui-1l06pbn"> [x: 10, x: 30) </code> to the recipient shard. </p> </div> </div> </td> </tr> </tbody> </table> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/replace-replica-set-member/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Replace a Self-Managed Replica Set Member <a class="headerlink leafygreen-ui-1kepx47" href="#replace-a-self-managed-replica-set-member" 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="replace-a-self-managed-replica-set-member"> </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="#operation" target="_self"> <span> Operation </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> If you need to change the hostname of a replica set member without changing the configuration of that member or the set, you can use the operation outlined in this tutorial. For example if you must re-provision systems or rename hosts, you can use this pattern to minimize the scope of that change. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Operation <a class="headerlink leafygreen-ui-1kepx47" href="#operation" 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="operation"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To change the hostname for a replica set member modify the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-.host"> <code class="leafygreen-ui-1l06pbn"> members[n].host </code> </a> field. The value of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-._id"> <code class="leafygreen-ui-1l06pbn"> members[n]._id </code> </a> field will not change when you reconfigure the set. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/"> Self-Managed Replica Set Configuration </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.reconfig/#mongodb-method-rs.reconfig"> <code class="leafygreen-ui-1l06pbn"> rs.reconfig() </code> </a> for more information. </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"> Any replica set configuration change can trigger the current <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> to step down, which forces an <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-elections/#std-label-replica-set-elections"> election </a> . During the election, the current shell session and clients connected to this replica set disconnect, which produces an error even when the operation succeeds. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To change the hostname to <code class="leafygreen-ui-1l06pbn"> mongo2.example.net </code> for the replica set member configured at <code class="leafygreen-ui-1l06pbn"> members[0] </code> , issue the following sequence of commands: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cfg = rs.conf()\ncfg.members[0].host = \"mongo2.example.net\"\nrs.reconfig(cfg)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cfg <!-- -->= <!-- -->rs.<span class="lg-highlight-title lg-highlight-function">conf</span>(<!-- -->)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">cfg.<span class="lg-highlight-property">members</span>[<span class="lg-highlight-number">0</span>].<span class="lg-highlight-property">host</span> <!-- -->= <span class="lg-highlight-string">"mongo2.example.net"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">reconfig</span>(<!-- -->cfg)</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> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/push/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $push (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-push--aggregation-" 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="-push--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="group"> <dt> <code class="leafygreen-ui-1l06pbn"> $push </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-group-grp.-push" 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-group-grp.-push"> </div> </a> </dt> <dd> </dd> </dl> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-push" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $push </code> </span> </a> returns an array of <em> all </em> values that result from applying an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> to documents. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-push" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $push </code> </span> </a> is available in these stages: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/bucket/#mongodb-pipeline-pipe.-bucket"> <code class="leafygreen-ui-1l06pbn"> $bucket </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/bucketAuto/#mongodb-pipeline-pipe.-bucketAuto"> <code class="leafygreen-ui-1l06pbn"> $bucketAuto </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> (Available starting in MongoDB 5.0) </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-push" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $push </code> </span> </a> syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $push: &lt;expression&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">{ $push: &lt;expression&gt; }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on expressions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> Expression Operators <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> When using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-push" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $push </code> </span> </a> in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> stage, the order of the documents coming into the pipeline determines the order of the documents in the output array. To guarantee a defined order, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> pipeline stage should follow a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sort/#mongodb-pipeline-pipe.-sort"> <code class="leafygreen-ui-1l06pbn"> $sort </code> </a> stage. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use in <code class="leafygreen-ui-1l06pbn"> $group </code> Stage <a class="headerlink leafygreen-ui-1kepx47" href="#use-in--group-stage" 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-in--group-stage"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Consider a <code class="leafygreen-ui-1l06pbn"> sales </code> collection with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"item\" : \"abc\", \"price\" : 10, \"quantity\" : 2, \"date\" : ISODate(\"2014-01-01T08:00:00Z\") }\n{ \"_id\" : 2, \"item\" : \"jkl\", \"price\" : 20, \"quantity\" : 1, \"date\" : ISODate(\"2014-02-03T09:00:00Z\") }\n{ \"_id\" : 3, \"item\" : \"xyz\", \"price\" : 5, \"quantity\" : 5, \"date\" : ISODate(\"2014-02-03T09:05:00Z\") }\n{ \"_id\" : 4, \"item\" : \"abc\", \"price\" : 10, \"quantity\" : 10, \"date\" : ISODate(\"2014-02-15T08:00:00Z\") }\n{ \"_id\" : 5, \"item\" : \"xyz\", \"price\" : 5, \"quantity\" : 10, \"date\" : ISODate(\"2014-02-15T09:05:00Z\") }\n{ \"_id\" : 6, \"item\" : \"xyz\", \"price\" : 5, \"quantity\" : 5, \"date\" : ISODate(\"2014-02-15T12:05:10Z\") }\n{ \"_id\" : 7, \"item\" : \"xyz\", \"price\" : 5, \"quantity\" : 10, \"date\" : ISODate(\"2014-02-15T14:12:12Z\") }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-01-01T08:00:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"jkl"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">20</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-02-03T09:00:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-02-03T09:05:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-02-15T08:00:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-02-15T09:05:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-02-15T12:05:10Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">7</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-02-15T14:12:12Z"</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"> Grouping the documents by the day and the year of the <code class="leafygreen-ui-1l06pbn"> date </code> field, the following operation uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-push" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $push </code> </span> </a> accumulator to compute the list of items and quantities sold for each group: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.sales.aggregate(\n [\n { $sort: { date: 1, item: 1 } },\n {\n $group:\n {\n _id: { day: { $dayOfYear: \"$date\"}, year: { $year: \"$date\" } },\n itemsSold: { $push: { item: \"$item\", quantity: \"$quantity\" } }\n }\n }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">sales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$sort</span>: <!-- -->{ <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-number">1</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$group</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <!-- -->{ <span class="lg-highlight-attr">day</span>: <!-- -->{ <span class="lg-highlight-attr">$dayOfYear</span>: <span class="lg-highlight-string">"$date"</span>}<!-- -->, <span class="lg-highlight-attr">year</span>: <!-- -->{ <span class="lg-highlight-attr">$year</span>: <span class="lg-highlight-string">"$date"</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">itemsSold</span>: <!-- -->{ <span class="lg-highlight-attr">$push</span>: <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"$item"</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-string">"$quantity"</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : { \"day\" : 46, \"year\" : 2014 },\n \"itemsSold\" : [\n { \"item\" : \"abc\", \"quantity\" : 10 },\n { \"item\" : \"xyz\", \"quantity\" : 10 },\n { \"item\" : \"xyz\", \"quantity\" : 5 },\n { \"item\" : \"xyz\", \"quantity\" : 10 }\n ]\n}\n{\n \"_id\" : { \"day\" : 34, \"year\" : 2014 },\n \"itemsSold\" : [\n { \"item\" : \"jkl\", \"quantity\" : 1 },\n { \"item\" : \"xyz\", \"quantity\" : 5 }\n ]\n}\n{\n \"_id\" : { \"day\" : 1, \"year\" : 2014 },\n \"itemsSold\" : [ { \"item\" : \"abc\", \"quantity\" : 2 } ]\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"day"</span> <!-- -->: <span class="lg-highlight-number">46</span>, <span class="lg-highlight-string">"year"</span> <!-- -->: <span class="lg-highlight-number">2014</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"itemsSold"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">10</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz"</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">10</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz"</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">5</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz"</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">10</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"day"</span> <!-- -->: <span class="lg-highlight-number">34</span>, <span class="lg-highlight-string">"year"</span> <!-- -->: <span class="lg-highlight-number">2014</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"itemsSold"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"jkl"</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"xyz"</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">5</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"day"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"year"</span> <!-- -->: <span class="lg-highlight-number">2014</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"itemsSold"</span> <!-- -->: <!-- -->[ <!-- -->{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">2</span> } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use in <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> Stage <a class="headerlink leafygreen-ui-1kepx47" href="#use-in--setwindowfields-stage" 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-in--setwindowfields-stage"> </div> </a> </h3> <div> <p> <em> New <!-- --> in version <!-- --> 5.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Create a <code class="leafygreen-ui-1l06pbn"> cakeSales </code> collection that contains cake sales in the states of California ( <code class="leafygreen-ui-1l06pbn"> CA </code> ) and Washington ( <code class="leafygreen-ui-1l06pbn"> WA </code> ): </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.insertMany( [\n { _id: 0, type: \"chocolate\", orderDate: new Date(\"2020-05-18T14:10:30Z\"),\n state: \"CA\", price: 13, quantity: 120 },\n { _id: 1, type: \"chocolate\", orderDate: new Date(\"2021-03-20T11:30:05Z\"),\n state: \"WA\", price: 14, quantity: 140 },\n { _id: 2, type: \"vanilla\", orderDate: new Date(\"2021-01-11T06:31:15Z\"),\n state: \"CA\", price: 12, quantity: 145 },\n { _id: 3, type: \"vanilla\", orderDate: new Date(\"2020-02-08T13:13:23Z\"),\n state: \"WA\", price: 13, quantity: 104 },\n { _id: 4, type: \"strawberry\", orderDate: new Date(\"2019-05-18T16:09:01Z\"),\n state: \"CA\", price: 41, quantity: 162 },\n { _id: 5, type: \"strawberry\", orderDate: new Date(\"2019-01-08T06:12:03Z\"),\n state: \"WA\", price: 43, quantity: 134 }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">120</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">140</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">145</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">104</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">162</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">134</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This example uses <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-push" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $push </code> </span> </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage to output an array of cake sales <code class="leafygreen-ui-1l06pbn"> quantity </code> values for each <code class="leafygreen-ui-1l06pbn"> state </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.aggregate( [\n {\n $setWindowFields: {\n partitionBy: \"$state\",\n sortBy: { orderDate: 1 },\n output: {\n quantitiesForState: {\n $push: \"$quantity\",\n window: {\n documents: [ \"unbounded\", \"current\" ]\n }\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <span class="lg-highlight-string">"$state"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quantitiesForState</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$push</span>: <span class="lg-highlight-string">"$quantity"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">window</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">documents</span>: <!-- -->[ <span class="lg-highlight-string">"unbounded"</span>, <span class="lg-highlight-string">"current"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> partitionBy: "$state" </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-partitionBy"> partitions </a> the documents in the collection by <code class="leafygreen-ui-1l06pbn"> state </code> . There are partitions for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sortBy: { orderDate: 1 } </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-sortBy"> sorts </a> the documents in each partition by <code class="leafygreen-ui-1l06pbn"> orderDate </code> in ascending order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ), so the earliest <code class="leafygreen-ui-1l06pbn"> orderDate </code> is first. </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> output </code> sets the array of <code class="leafygreen-ui-1l06pbn"> quantity </code> values using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-push" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $push </code> </span> </a> for the documents in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-documents"> documents </a> window. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-window"> window </a> contains documents between an <code class="leafygreen-ui-1l06pbn"> unbounded </code> lower limit and the <code class="leafygreen-ui-1l06pbn"> current </code> document in the output. This means <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-push" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $push </code> </span> </a> appends the <code class="leafygreen-ui-1l06pbn"> quantity </code> values to the <code class="leafygreen-ui-1l06pbn"> quantitiesForState </code> array for the documents between the beginning of the partition and the current document. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> In this output, the array of <code class="leafygreen-ui-1l06pbn"> quantity </code> values for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> is shown in the <code class="leafygreen-ui-1l06pbn"> quantitiesForState </code> array: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 4, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-05-18T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 41, \"quantity\" : 162, \"quantitiesForState\" : [ 162 ] }\n{ \"_id\" : 0, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2020-05-18T14:10:30Z\"),\n \"state\" : \"CA\", \"price\" : 13, \"quantity\" : 120, \"quantitiesForState\" : [ 162, 120 ] }\n{ \"_id\" : 2, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2021-01-11T06:31:15Z\"),\n \"state\" : \"CA\", \"price\" : 12, \"quantity\" : 145, \"quantitiesForState\" : [ 162, 120, 145 ] }\n{ \"_id\" : 5, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 43, \"quantity\" : 134, \"quantitiesForState\" : [ 134 ] }\n{ \"_id\" : 3, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2020-02-08T13:13:23Z\"),\n \"state\" : \"WA\", \"price\" : 13, \"quantity\" : 104, \"quantitiesForState\" : [ 134, 104 ] }\n{ \"_id\" : 1, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2021-03-20T11:30:05Z\"),\n \"state\" : \"WA\", \"price\" : 14, \"quantity\" : 140, \"quantitiesForState\" : [ 134, 104, 140 ] }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>, <span class="lg-highlight-string">"quantitiesForState"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">162</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">120</span>, <span class="lg-highlight-string">"quantitiesForState"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">162</span>, <span class="lg-highlight-number">120</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">145</span>, <span class="lg-highlight-string">"quantitiesForState"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">162</span>, <span class="lg-highlight-number">120</span>, <span class="lg-highlight-number">145</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"quantitiesForState"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">134</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">104</span>, <span class="lg-highlight-string">"quantitiesForState"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">134</span>, <span class="lg-highlight-number">104</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">140</span>, <span class="lg-highlight-string">"quantitiesForState"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">134</span>, <span class="lg-highlight-number">104</span>, <span class="lg-highlight-number">140</span> ] }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/change-events/drop/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> drop Event <a class="headerlink leafygreen-ui-1kepx47" href="#drop-event" 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="drop-event"> </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="#synopsis" target="_self"> <span> Synopsis </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#description" target="_self"> <span> Description </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Synopsis <a class="headerlink leafygreen-ui-1kepx47" href="#synopsis" 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="synopsis"> </div> </a> </h2> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> drop </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-drop" 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-data-drop"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A <code class="leafygreen-ui-1l06pbn"> drop </code> event occurs when a collection is dropped from a database. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Description <a class="headerlink leafygreen-ui-1kepx47" href="#description" 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="description"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:60%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> _id </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--id"> </span> <p class="leafygreen-ui-1kp3ins"> A <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-BSON"> BSON </a> object which serves as an identifier for the change stream event. This value is used as the <code class="leafygreen-ui-1l06pbn"> resumeToken </code> for the <code class="leafygreen-ui-1l06pbn"> resumeAfter </code> parameter when resuming a change stream. The <code class="leafygreen-ui-1l06pbn"> _id </code> object has the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_data\" : &lt;bindata|hex&gt;\n}"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "_data" : &lt;BinData|hex string&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> _data </code> type depends on the MongoDB versions and, in some cases, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-view-fcv"> feature compatibility version (fCV) </a> at the time of the change stream's opening or resumption. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/changeStreams/#std-label-change-stream-resume-token"> Resume Tokens </a> for the full list of <code class="leafygreen-ui-1l06pbn"> _data </code> types. </p> <p class="leafygreen-ui-1kp3ins"> For an example of resuming a change stream by <code class="leafygreen-ui-1l06pbn"> resumeToken </code> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/changeStreams/#std-label-change-stream-resume"> Resume a Change Stream <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> clusterTime </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Timestamp </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--clusterTime"> </span> <p class="leafygreen-ui-1kp3ins"> The timestamp from the oplog entry associated with the event. </p> <p class="leafygreen-ui-1kp3ins"> Change stream event notifications associated with a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions"> multi-document transaction </a> all have the same <code class="leafygreen-ui-1l06pbn"> clusterTime </code> value: the time when the transaction was committed. </p> <p class="leafygreen-ui-1kp3ins"> Events with the same <code class="leafygreen-ui-1l06pbn"> clusterTime </code> may not all relate to the same transaction. Some events don't relate to a transaction at all. Starting in MongoDB 8.0, this may be true for events on any deployment. In previous versions, this behavior was possible only for events on a sharded cluster. </p> <p class="leafygreen-ui-1kp3ins"> To identify events for a single transaction, you can use the combination of <code class="leafygreen-ui-1l06pbn"> lsid </code> and <code class="leafygreen-ui-1l06pbn"> txnNumber </code> in the change stream event document. </p> <div> <p> <em> Changed <!-- --> in version <!-- --> 8.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> collectionUUID </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UUID </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--collectionUUID"> </span> <p class="leafygreen-ui-1kp3ins"> If the change occurred on a collection, <code class="leafygreen-ui-1l06pbn"> collectionUUID </code> indicates the collection's <span class="leafygreen-ui-vm4wms" tabindex="0"> UUID </span> . If the change occurred on a view, <code class="leafygreen-ui-1l06pbn"> collectionUUID </code> doesn't exist. </p> <div> <p> <em> New <!-- --> in version <!-- --> 6.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> lsid </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--lsid"> </span> <p class="leafygreen-ui-1kp3ins"> The identifier for the session associated with the transaction. </p> <p class="leafygreen-ui-1kp3ins"> Only present if the operation is part of a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/"> multi-document transaction <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> ns </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--ns"> </span> <p class="leafygreen-ui-1kp3ins"> The namespace (database and or collection) affected by the event. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> ns.coll </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--ns.coll"> </span> <p class="leafygreen-ui-1kp3ins"> The name of the collection where the event occurred. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> ns.db </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--ns.db"> </span> <p class="leafygreen-ui-1kp3ins"> The name of the database where the event occurred. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> operationType </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--operationType"> </span> <p class="leafygreen-ui-1kp3ins"> The type of operation that the change notification reports. </p> <p class="leafygreen-ui-1kp3ins"> Returns a value of <code class="leafygreen-ui-1l06pbn"> drop </code> for these change events. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> txnNumber </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NumberLong </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--txnNumber"> </span> <p class="leafygreen-ui-1kp3ins"> Together with the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label--idref--lsid" target="_self"> <span> lsid </span> </a> , a number that helps uniquely identify a transction. </p> <p class="leafygreen-ui-1kp3ins"> Only present if the operation is part of a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/"> multi-document transaction <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> wallTime </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-ISODate"> ISODate </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--wallTime"> </span> <p class="leafygreen-ui-1kp3ins"> The server date and time of the database operation. <code class="leafygreen-ui-1l06pbn"> wallTime </code> differs from <code class="leafygreen-ui-1l06pbn"> clusterTime </code> in that <code class="leafygreen-ui-1l06pbn"> clusterTime </code> is a timestamp taken from the oplog entry associated with the database operation event. </p> <div> <p> <em> New <!-- --> in version <!-- --> 6.0 </em> . </p> </div> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example illustrates a <code class="leafygreen-ui-1l06pbn"> drop </code> event: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\": { &lt;resume&gt; },\n \"operationType\": \"drop\",\n \"clusterTime\": &lt;timestamp&gt;,\n \"wallTime\": &lt;isodate&gt;,\n \"ns\": {\n \"db\": \"engineering\",\n \"coll\": \"users\"\n }\n}","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"_id"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span> &lt;Resume Token&gt; <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"operationType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"drop"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"clusterTime"</span><span class="lg-highlight-punctuation">:</span> &lt;Timestamp&gt;<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"wallTime"</span><span class="lg-highlight-punctuation">:</span> &lt;ISODate&gt;<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"ns"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"db"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"engineering"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"coll"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"users"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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"> A <code class="leafygreen-ui-1l06pbn"> drop </code> event leads to an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/change-events/invalidate/#mongodb-data-invalidate"> <code class="leafygreen-ui-1l06pbn"> invalidate </code> </a> event for change streams opened against its own <code class="leafygreen-ui-1l06pbn"> ns </code> collection. </p> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/modify-chunk-size-in-sharded-cluster/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Modify Range Size in a Sharded Cluster <a class="headerlink leafygreen-ui-1kepx47" href="#modify-range-size-in-a-sharded-cluster" 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="modify-range-size-in-a-sharded-cluster"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> The default range size for a sharded cluster is 128 megabytes. This default range size works well for most deployments; however, if you notice that automatic migrations use more I/O than your hardware can handle, you may want to reduce the range size. A small range size leads to more rapid and frequent migrations. The allowed size is between 1 and 1024 megabytes, inclusive. </p> <p class="leafygreen-ui-1kp3ins"> To modify the range size, use the following procedure: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Connect to any <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> in the cluster using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Issue the following command to switch to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/config-database/#std-label-config-database"> Config Database <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use config","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use config</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Issue the following command to store the global range size configuration value: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.settings.updateOne(\n { _id: \"chunksize\" },\n { $set: { _id: \"chunksize\", value: &lt;sizeinmb&gt; } },\n { upsert: true }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">settings</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"chunksize"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$set</span>: <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"chunksize"</span>, <span class="lg-highlight-attr">value</span>: &lt;<!-- -->sizeInMB<!-- -->&gt; <!-- -->} }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">upsert</span>: <span class="lg-highlight-literal">true</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ol> <p class="leafygreen-ui-1kp3ins"> The allowed range size is between 1 and 1024 megabytes, inclusive. </p> <p class="leafygreen-ui-1kp3ins"> To set the chunk size for a specific collection, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/configureCollectionBalancing/#mongodb-dbcommand-dbcmd.configureCollectionBalancing"> <code class="leafygreen-ui-1l06pbn"> configureCollectionBalancing </code> . </a> </p> </section>
https://www.mongodb.com/docs/manual/reference/command/killOp/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> killOp <a class="headerlink leafygreen-ui-1kepx47" href="#killop" 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="killop"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#command-fields" target="_self"> <span> Command Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> killOp </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.killOp" 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-dbcommand-dbcmd.killOp"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Terminates an operation as specified by the operation ID. <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> provides the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.killOp/#mongodb-method-db.killOp"> <code class="leafygreen-ui-1l06pbn"> db.killOp() </code> </a> helper. To find operations and their corresponding IDs, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/currentOp/#mongodb-pipeline-pipe.-currentOp"> <code class="leafygreen-ui-1l06pbn"> $currentOp </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.currentOp/#mongodb-method-db.currentOp"> <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> killOp </code> command must be run against the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </p> <p class="leafygreen-ui-1kp3ins"> To run <!-- --> killOp <!-- --> , use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.runCommand/#mongodb-method-db.runCommand"> <code class="leafygreen-ui-1l06pbn"> db.runCommand( { &lt;command&gt; } ) </code> </a> method. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <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 command has limited support in M0, M2, M5, and M10+ clusters. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command has the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand(\n {\n killOp: 1,\n op: &lt;opid&gt;,\n comment: &lt;any&gt;\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">killOp</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">op</span>: &lt;<!-- -->opid<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">comment</span>: &lt;<!-- -->any<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Command Fields <a class="headerlink leafygreen-ui-1kepx47" href="#command-fields" 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="command-fields"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> op </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> number </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An operation ID. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> comment </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> any </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. A user-provided comment to attach to this command. Once set, this comment appears alongside records of this command in the following locations: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-messages-ref"> mongod log messages </a> , in the <code class="leafygreen-ui-1l06pbn"> attr.command.cursor.comment </code> field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/database-profiler/#std-label-profiler"> Database profiler </a> output, in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/database-profiler/#mongodb-data-system.profile.command"> <code class="leafygreen-ui-1l06pbn"> command.comment </code> </a> field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-dbcommand-dbcmd.currentOp"> <code class="leafygreen-ui-1l06pbn"> currentOp </code> </a> output, in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-data-currentOp.command"> <code class="leafygreen-ui-1l06pbn"> command.comment </code> </a> field. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> A comment can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-bson-types"> BSON type </a> (string, integer, object, array, etc). </p> </div> </div> </td> </tr> </tbody> </table> </div> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Terminate running operations with extreme caution. Only use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.killOp" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> killOp </code> </span> </a> to terminate operations initiated by clients and <em> do not </em> terminate internal database operations. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Do <em> not </em> use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.killOp" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> killOp </code> </span> </a> to terminate an in-progress index builds in replica sets or sharded clusters. Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dropIndexes/#mongodb-dbcommand-dbcmd.dropIndexes"> <code class="leafygreen-ui-1l06pbn"> dropIndexes </code> </a> on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> to drop the index. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dropIndexes/#std-label-dropIndexes-cmd-index-builds"> Stop In-Progress Index Builds <!-- --> . </a> </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Access Control <a class="headerlink leafygreen-ui-1kepx47" href="#access-control" 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="access-control"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> On systems running with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.authorization"> <code class="leafygreen-ui-1l06pbn"> authorization </code> </a> , to kill operations not owned by the user, the user must have access that includes the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-killop"> <code class="leafygreen-ui-1l06pbn"> killop </code> </a> privilege action. </p> <p class="leafygreen-ui-1kp3ins"> On <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances, users can kill their own operations even without the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-killop"> <code class="leafygreen-ui-1l06pbn"> killop </code> </a> privilege action. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sharded Cluster <a class="headerlink leafygreen-ui-1kepx47" href="#sharded-cluster" 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="sharded-cluster"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.killOp" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> killOp </code> </span> </a> command can be run on a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> and can kill queries (i.e. read operations) that span shards in a cluster. The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.killOp" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> killOp </code> </span> </a> command from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> does not propagate to the shards when the operation to be killed is a write operation. </p> <p class="leafygreen-ui-1kp3ins"> For information on how to list sharding operations that are active on a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , see the <code class="leafygreen-ui-1l06pbn"> localOps </code> parameter in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/currentOp/#mongodb-pipeline-pipe.-currentOp"> <code class="leafygreen-ui-1l06pbn"> $currentOp </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> For more information and examples on killing operations on a sharded cluster, see: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.killOp/#std-label-kill-read-ops-sharded-cluster"> Kill Read Operations </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.killOp/#std-label-kill-write-ops-sharded-cluster"> Kill Write Operations </a> </p> </li> </ul> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example uses <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.killOp" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> killOp </code> </span> </a> to target the running operation with opid <code class="leafygreen-ui-1l06pbn"> 3478 </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { \"killOp\": 1, \"op\": 3478 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-string">"killOp"</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"op"</span>: <span class="lg-highlight-number">3478</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 operation returns the following result: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"info\" : \"attempting to kill op\", \"ok\" : 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"info"</span> <!-- -->: <span class="lg-highlight-string">"attempting to kill op"</span>, <span class="lg-highlight-string">"ok"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.killOp" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> killOp </code> </span> </a> reports success if it succeeded in marking the specified operation for termination. Operations may not actually be terminated until they reach an appropriate interruption point. Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/currentOp/#mongodb-pipeline-pipe.-currentOp"> <code class="leafygreen-ui-1l06pbn"> $currentOp </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.currentOp/#mongodb-method-db.currentOp"> <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> </a> to confirm the target operation was terminated. </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/rtrim/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $rtrim (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-rtrim--aggregation-" 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="-rtrim--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $rtrim </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-rtrim" 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-expression-exp.-rtrim"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Removes whitespace characters, including null, or the specified characters from the end of a string. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-rtrim" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rtrim </code> </span> </a> has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $rtrim: { input: &lt;string&gt;, chars: &lt;string&gt; } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$rtrim</span>: <!-- -->{ <span class="lg-highlight-attr">input</span>: &lt;<!-- -->string<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-attr">chars</span>: &lt;<!-- -->string<!-- -->&gt; <!-- -->} }</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 <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-rtrim" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rtrim </code> </span> </a> takes a document with the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> input </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The string to trim. The argument can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a string. For more information on expressions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> Expression Operators <!-- --> . </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> chars </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The character(s) to trim from the end of the <code class="leafygreen-ui-1l06pbn"> input </code> . </p> <p class="leafygreen-ui-1kp3ins"> The argument can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a string. The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-rtrim" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rtrim </code> </span> </a> operator breaks down the string into individual UTF <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.unicode.org/glossary/#code_point" rel="noopener noreferrer"> <span> code point </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> to trim from <code class="leafygreen-ui-1l06pbn"> input </code> . </p> <p class="leafygreen-ui-1kp3ins"> If unspecified, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-rtrim" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rtrim </code> </span> </a> removes whitespace characters, including the null character. For the list of whitespace characters, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-rtrim-white-space" target="_self"> <span> Whitespace Characters <!-- --> . </span> </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> <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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/ltrim/#mongodb-expression-exp.-ltrim"> <code class="leafygreen-ui-1l06pbn"> $ltrim </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/trim/#mongodb-expression-exp.-trim"> <code class="leafygreen-ui-1l06pbn"> $trim </code> </a> </p> </li> </ul> </div> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> By default, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-rtrim" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rtrim </code> </span> </a> removes whitespace, including the null character, from the end of the input string: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:70%"/> <col style="width:30%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Results </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $rtrim: { input: " \n good bye \t " } } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> " \n good bye" </code> </div> </div> </td> </tr> </tbody> </table> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can override the default characters to trim using the <code class="leafygreen-ui-1l06pbn"> chars </code> field. </p> <p class="leafygreen-ui-1kp3ins"> For example, the following trims any <code class="leafygreen-ui-1l06pbn"> g </code> and <code class="leafygreen-ui-1l06pbn"> e </code> from the end of the input string. Since the input ends with a whitespace, neither character can be trimmed from the end of the string. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:70%"/> <col style="width:30%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Results </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $rtrim: { input: "ggggoodbyeeeee ", chars: "ge" } } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> "ggggoodbyeeeee " </code> </div> </div> </td> </tr> </tbody> </table> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If overriding the default characters to trim, you can explicitly include the whitespace character(s) to trim in the <code class="leafygreen-ui-1l06pbn"> chars </code> field. </p> <p class="leafygreen-ui-1kp3ins"> For example, the following trims any space or <code class="leafygreen-ui-1l06pbn"> e </code> from the end of the input string. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:80%"/> <col style="width:20%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Results </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $rtrim: { input: " ggggoodbyeeeee ", chars: "e " } } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> " ggggoodby" </code> </div> </div> </td> </tr> </tbody> </table> </div> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-rtrim-white-space"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Whitespace Characters <a class="headerlink leafygreen-ui-1kepx47" href="#whitespace-characters" 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="whitespace-characters"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> By default, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-rtrim" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rtrim </code> </span> </a> removes the following whitespace, including the null character: </p> <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> Unicode </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Escape sequence </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+0000 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> '0' </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Null character </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+0020 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ' ' </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Space </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+0009 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 't' </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Horizontal tab </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+000A </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 'n' </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Line feed/new line </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+000B </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 'v' </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Vertical tab </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+000C </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 'f' </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Form feed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+000D </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 'r' </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Carriage return </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+00A0 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Non-breaking space </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+1680 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Ogham space mark </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+2000 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> En quad </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+2001 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Em quad </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+2002 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> En space </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+2003 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Em space </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+2004 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Three-per-em space </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+2005 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Four-per-em space </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+2006 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Six-per-em space </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+2007 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Figure space </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+2008 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Punctuation space </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+2009 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Thin space </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> U+200A </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Hair space </div> </div> </td> </tr> </tbody> </table> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Consider an <code class="leafygreen-ui-1l06pbn"> inventory </code> collection with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"item\" : \"ABC1\", quarter: \"13Q1\", \"description\" : \" product 1\" }\n{ \"_id\" : 2, \"item\" : \"ABC2\", quarter: \"13Q4\", \"description\" : \"product 2 \\n The product is in stock. \\n\\n \" }\n{ \"_id\" : 3, \"item\" : \"XYZ1\", quarter: \"14Q2\", \"description\" : null }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"ABC1"</span>, <span class="lg-highlight-attr">quarter</span>: <span class="lg-highlight-string">"13Q1"</span>, <span class="lg-highlight-string">"description"</span> <!-- -->: <span class="lg-highlight-string">" product 1"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"ABC2"</span>, <span class="lg-highlight-attr">quarter</span>: <span class="lg-highlight-string">"13Q4"</span>, <span class="lg-highlight-string">"description"</span> <!-- -->: <span class="lg-highlight-string">"product 2 </span><span class="lg-highlight-string">\n</span><span class="lg-highlight-string"> The product is in stock. </span><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">\n</span><span class="lg-highlight-string"> "</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"XYZ1"</span>, <span class="lg-highlight-attr">quarter</span>: <span class="lg-highlight-string">"14Q2"</span>, <span class="lg-highlight-string">"description"</span> <!-- -->: <span class="lg-highlight-literal">null</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-rtrim" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $rtrim </code> </span> </a> operator to remove trailing whitespace from the <code class="leafygreen-ui-1l06pbn"> description </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.aggregate([\n { $project: { item: 1, description: { $rtrim: { input: \"$description\" } } } }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$project</span>: <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">description</span>: <!-- -->{ <span class="lg-highlight-attr">$rtrim</span>: <!-- -->{ <span class="lg-highlight-attr">input</span>: <span class="lg-highlight-string">"$description"</span> } } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"item\" : \"ABC1\", \"description\" : \" product 1\" }\n{ \"_id\" : 2, \"item\" : \"ABC2\", \"description\" : \"product 2 \\n The product is in stock.\" }\n{ \"_id\" : 3, \"item\" : \"XYZ1\", \"description\" : null }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"ABC1"</span>, <span class="lg-highlight-string">"description"</span> <!-- -->: <span class="lg-highlight-string">" product 1"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"ABC2"</span>, <span class="lg-highlight-string">"description"</span> <!-- -->: <span class="lg-highlight-string">"product 2 </span><span class="lg-highlight-string">\n</span><span class="lg-highlight-string"> The product is in stock."</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"XYZ1"</span>, <span class="lg-highlight-string">"description"</span> <!-- -->: <span class="lg-highlight-literal">null</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> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/connect/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> connect() <a class="headerlink leafygreen-ui-1kepx47" href="#connect--" 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="connect--"> </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="#description" target="_self"> <span> Description </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Description <a class="headerlink leafygreen-ui-1kepx47" href="#description" 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="description"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> connect(url, user, password) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-connect" 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-method-connect"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Creates a connection to a MongoDB instance and returns the reference to the database. However, in most cases, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> object and its <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo.getDB/#mongodb-method-Mongo.getDB"> <code class="leafygreen-ui-1l06pbn"> getDB() </code> </a> method instead. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> url </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Specifies the connection string. You can specify either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;hostname&gt;:&lt;port&gt;/&lt;database&gt; </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;hostname&gt;/&lt;database&gt; </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;database&gt; </code> </p> </li> </ul> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> user </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. Specifies an existing username with access privileges for this database. If <code class="leafygreen-ui-1l06pbn"> user </code> is specified, you must include the <code class="leafygreen-ui-1l06pbn"> password </code> parameter as well. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> password </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional unless the <code class="leafygreen-ui-1l06pbn"> user </code> parameter is specified. Specifies the password for the <code class="leafygreen-ui-1l06pbn"> user </code> . </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example instantiates a new connection to the MongoDB instance running on the localhost interface and returns a reference to <code class="leafygreen-ui-1l06pbn"> myDatabase </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db = connect(\"localhost:27017/myDatabase\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db <!-- -->= <span class="lg-highlight-title lg-highlight-function">connect</span>(<span class="lg-highlight-string">"localhost:27017/myDatabase"</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-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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo.getDB/#mongodb-method-Mongo.getDB"> <code class="leafygreen-ui-1l06pbn"> Mongo.getDB() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.auth/#mongodb-method-db.auth"> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </a> </p> </li> </ul> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/concat/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $concat (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-concat--aggregation-" 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="-concat--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $concat </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-concat" 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-expression-exp.-concat"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Concatenates strings and returns the concatenated string. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $concat </code> has this syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $concat: [ &lt;expression1&gt;, &lt;expression2&gt;, ... ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$concat</span>: <!-- -->[ &lt;<!-- -->expression1<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->expression2<!-- -->&gt;<!-- -->,<!-- --> <!-- -->...<!-- --> ] }</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 arguments can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> as long as they resolve to strings. For more information on expressions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> Expression Operators <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If the argument resolves to a value of <code class="leafygreen-ui-1l06pbn"> null </code> or refers to a field that is missing, <code class="leafygreen-ui-1l06pbn"> $concat </code> returns <code class="leafygreen-ui-1l06pbn"> null </code> . </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Create an <code class="leafygreen-ui-1l06pbn"> inventory </code> collection with these documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.insertMany( [\n { _id : 1, item : \"ABC1\", quarter: \"13Q1\", description : \"product 1\" },\n { _id : 2, item : \"ABC2\", quarter: \"13Q4\", description : \"product 2\" },\n { _id : 3, item : \"XYZ1\", quarter: \"14Q2\", description : null }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">1</span>, <!-- -->item <!-- -->: <span class="lg-highlight-string">"ABC1"</span>, <span class="lg-highlight-attr">quarter</span>: <span class="lg-highlight-string">"13Q1"</span>, <!-- -->description <!-- -->: <span class="lg-highlight-string">"product 1"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">2</span>, <!-- -->item <!-- -->: <span class="lg-highlight-string">"ABC2"</span>, <span class="lg-highlight-attr">quarter</span>: <span class="lg-highlight-string">"13Q4"</span>, <!-- -->description <!-- -->: <span class="lg-highlight-string">"product 2"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">3</span>, <!-- -->item <!-- -->: <span class="lg-highlight-string">"XYZ1"</span>, <span class="lg-highlight-attr">quarter</span>: <span class="lg-highlight-string">"14Q2"</span>, <!-- -->description <!-- -->: <span class="lg-highlight-literal">null</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Use the <code class="leafygreen-ui-1l06pbn"> $concat </code> operator to concatenate the <code class="leafygreen-ui-1l06pbn"> item </code> field and the <code class="leafygreen-ui-1l06pbn"> description </code> field with a " - " delimiter: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.aggregate(\n [\n { $project: { itemDescription: { $concat: [ \"$item\", \" - \", \"$description\" ] } } }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$project</span>: <!-- -->{ <span class="lg-highlight-attr">itemDescription</span>: <!-- -->{ <span class="lg-highlight-attr">$concat</span>: <!-- -->[ <span class="lg-highlight-string">"$item"</span>, <span class="lg-highlight-string">" - "</span>, <span class="lg-highlight-string">"$description"</span> ] } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ _id : 1, itemDescription : \"ABC1 - product 1\" }\n{ _id : 2, itemDescription : \"ABC2 - product 2\" }\n{ _id : 3, itemDescription : null }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">1</span>, <!-- -->itemDescription <!-- -->: <span class="lg-highlight-string">"ABC1 - product 1"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">2</span>, <!-- -->itemDescription <!-- -->: <span class="lg-highlight-string">"ABC2 - product 2"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">3</span>, <!-- -->itemDescription <!-- -->: <span class="lg-highlight-literal">null</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/query-evaluation/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Evaluation Query Operators <a class="headerlink leafygreen-ui-1kepx47" href="#evaluation-query-operators" 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="evaluation-query-operators"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> Evaluation operators return data based on evaluations of either individual fields or the entire collection's documents. </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"> For details on a specific operator, including syntax and examples, click on the link to the operator's reference page. </p> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/expr/#mongodb-query-op.-expr"> <code class="leafygreen-ui-1l06pbn"> $expr </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Allows use of aggregation expressions within the query language. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/jsonSchema/#mongodb-query-op.-jsonSchema"> <code class="leafygreen-ui-1l06pbn"> $jsonSchema </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Validate documents against the given JSON Schema. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/mod/#mongodb-query-op.-mod"> <code class="leafygreen-ui-1l06pbn"> $mod </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Performs a modulo operation on the value of a field and selects documents with a specified result. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/regex/#mongodb-query-op.-regex"> <code class="leafygreen-ui-1l06pbn"> $regex </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Selects documents where values match a specified regular expression. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/where/#mongodb-query-op.-where"> <code class="leafygreen-ui-1l06pbn"> $where </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Matches documents that satisfy a JavaScript expression. </div> </div> </td> </tr> </tbody> </table> </div> </section>
https://www.mongodb.com/docs/manual/core/ranged-sharding/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Ranged Sharding <a class="headerlink leafygreen-ui-1kepx47" href="#ranged-sharding" 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="ranged-sharding"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> Range-based sharding involves dividing data into contiguous ranges determined by the shard key values. In this model, documents with "close" shard key values are likely to be in the same <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-chunk"> chunk </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard"> shard </a> . This allows for efficient queries where reads target documents within a contiguous range. However, both read and write performance may decrease with poor shard key selection. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-sharding-ranged-shard-key" target="_self"> <span> Shard Key Selection <!-- --> . </span> </a> </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> <p class="leafygreen-ui-1kp3ins"> Range-based sharding is the default sharding methodology if no other options such as those required for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/hashed-sharding/"> Hashed Sharding </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/zone-sharding/#std-label-zone-sharding"> zones </a> are configured. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-sharding-ranged-shard-key"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Shard Key Selection <a class="headerlink leafygreen-ui-1kepx47" href="#shard-key-selection" 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="shard-key-selection"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Ranged sharding is most efficient when the shard key displays the following traits: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Large <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-choose-a-shard-key/#std-label-shard-key-range"> Shard Key Cardinality </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Low <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-choose-a-shard-key/#std-label-shard-key-frequency"> Shard Key Frequency </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Non- <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-choose-a-shard-key/#std-label-shard-key-monotonic"> Monotonically Changing Shard Keys </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The following image illustrates a sharded cluster using the field <code class="leafygreen-ui-1l06pbn"> X </code> as the shard key. If the values for <code class="leafygreen-ui-1l06pbn"> X </code> have a large range, low frequency, and change at a non-monotonic rate, the distribution of inserts may look similar to the following: </p> <div class="css-y1v7l ej97su30"> <div role="button" tabindex="-1"> <img alt="Diagram of good shard key distribution" class="leafygreen-ui-1qnf57e" height="600" src="/docs/manual/images/sharded-cluster-ranged-distribution-good.bakedsvg.svg" style="--border-color:#C1C7C6" width="1200"/> <div class="css-19pi7x2 ej97su31" style="--color:#444"> click to enlarge </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Shard a Collection <a class="headerlink leafygreen-ui-1kepx47" href="#shard-a-collection" 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="shard-a-collection"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.shardCollection/#mongodb-method-sh.shardCollection"> <code class="leafygreen-ui-1l06pbn"> sh.shardCollection() </code> </a> method, specifying the full namespace of the collection and the target <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-index"> index </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-compound-index"> compound index </a> to use as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key"> shard key <!-- --> . </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.shardCollection( \"database.collection\", { &lt;shard&gt; } )","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">sh.<span class="lg-highlight-title lg-highlight-function">shardCollection</span>( <span class="lg-highlight-string">"database.collection"</span>, <!-- -->{ <span class="lg-highlight-tag lg-highlight-xml">&lt;</span><span class="lg-highlight-name lg-highlight-tag lg-highlight-xml">shard</span><span class="lg-highlight-tag lg-highlight-xml"> </span><span class="lg-highlight-attr lg-highlight-tag lg-highlight-xml">key</span><span class="lg-highlight-tag lg-highlight-xml">&gt;</span><span class="lg-highlight-xml"> } )</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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, you can <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-reshard-a-collection/#std-label-sharding-resharding"> reshard a collection </a> by changing a collection's shard key. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-refine-a-shard-key/#std-label-shard-key-refine"> refine a shard key </a> by adding a suffix field or fields to the existing shard key. </p> </li> </ul> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Shard a Populated Collection <a class="headerlink leafygreen-ui-1kepx47" href="#shard-a-populated-collection" 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="shard-a-populated-collection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you shard a populated collection, only one chunk is created initially. The balancer then migrates ranges from that chunk if necessary according to the configured range size. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Shard an Empty Collection <a class="headerlink leafygreen-ui-1kepx47" href="#shard-an-empty-collection" 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="shard-an-empty-collection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you shard an empty collection: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> With no <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/zone-sharding/#std-label-zone-sharding"> zones and zone ranges </a> specified for the empty or non-existing collection: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The sharding operation creates a single empty chunk to cover the entire range of the shard key values. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> After the initial chunk creation, the balancer migrates the initial chunk across the shards as appropriate as well as manages the chunk distribution going forward. </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> With zones and zone ranges specified for the empty or a non-existing collections: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The sharding operation creates empty chunks for the defined zone ranges as well as any additional chunks to cover the entire range of the shard key values and performs an initial chunk distribution based on the zone ranges. This initial creation and distribution of chunks allows for faster setup of zoned sharding. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> After the initial distribution, the balancer manages the chunk distribution going forward. </p> </li> </ul> </li> </ul> <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"> To learn how to deploy a sharded cluster and implement ranged sharding, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/deploy-shard-cluster/#std-label-sharding-procedure-setup"> Deploy a Self-Managed Sharded Cluster <!-- --> . </a> </p> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/core/collection-level-access-control/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Collection-Level Access Control in Self-Managed Deployments <a class="headerlink leafygreen-ui-1kepx47" href="#collection-level-access-control-in-self-managed-deployments" 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="collection-level-access-control-in-self-managed-deployments"> </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="#privileges-and-scope" target="_self"> <span> Privileges and Scope </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#additional-information" target="_self"> <span> Additional Information </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> Collection-level access control allows administrators to grant users privileges that are scoped to specific collections. </p> <p class="leafygreen-ui-1kp3ins"> Administrators can implement collection-level access control through <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-user-defined-roles/#std-label-user-defined-roles"> user-defined roles </a> . By creating a role with <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/#std-label-privileges"> privileges </a> that are scoped to a specific collection in a particular database, administrators can provision users with roles that grant privileges on a collection level. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Privileges and Scope <a class="headerlink leafygreen-ui-1kepx47" href="#privileges-and-scope" 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="privileges-and-scope"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A privilege consists of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#std-label-security-user-actions"> actions </a> and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/resource-document/#std-label-resource-document"> resources </a> upon which the actions are permissible; i.e. the resources define the scope of the actions for that privilege. </p> <p class="leafygreen-ui-1kp3ins"> By specifying both the database and the collection in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/resource-document/#std-label-resource-specific-db-collection"> resource document </a> for a privilege, administrator can limit the privilege actions just to a specific collection in a specific database. Each privilege action in a role can be scoped to a different collection. </p> <p class="leafygreen-ui-1kp3ins"> For example, a user defined role can contain the following privileges: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"privileges: [\n { resource: { db: \"products\", collection: \"inventory\" }, actions: [ \"find\", \"update\", \"insert\" ] },\n { resource: { db: \"products\", collection: \"orders\" }, actions: [ \"find\" ] }\n]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">privileges</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">resource</span>: <!-- -->{ <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"products"</span>, <span class="lg-highlight-attr">collection</span>: <span class="lg-highlight-string">"inventory"</span> }<!-- -->, <span class="lg-highlight-attr">actions</span>: <!-- -->[ <span class="lg-highlight-string">"find"</span>, <span class="lg-highlight-string">"update"</span>, <span class="lg-highlight-string">"insert"</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">resource</span>: <!-- -->{ <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"products"</span>, <span class="lg-highlight-attr">collection</span>: <span class="lg-highlight-string">"orders"</span> }<!-- -->, <span class="lg-highlight-attr">actions</span>: <!-- -->[ <span class="lg-highlight-string">"find"</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The first privilege scopes its actions to the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection of the <code class="leafygreen-ui-1l06pbn"> products </code> database. The second privilege scopes its actions to the <code class="leafygreen-ui-1l06pbn"> orders </code> collection of the <code class="leafygreen-ui-1l06pbn"> products </code> database. </p> <p class="leafygreen-ui-1kp3ins"> As a best practice, avoid assigning <code class="leafygreen-ui-1l06pbn"> createCollection </code> privileges to users who don't have read privileges on the collection. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Additional Information <a class="headerlink leafygreen-ui-1kepx47" href="#additional-information" 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="additional-information"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> For more information on user-defined roles and MongoDB authorization model, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/"> Role-Based Access Control in Self-Managed Deployments </a> . For a tutorial on creating user-defined roles, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-users-and-roles/"> Manage Users and Roles on Self-Managed Deployments <!-- --> . </a> </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/configuration-file-settings-command-line-options-mapping/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Self-Managed Configuration File Settings and Command-Line Options Mapping <a class="headerlink leafygreen-ui-1kepx47" href="#self-managed-configuration-file-settings-and-command-line-options-mapping" 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="self-managed-configuration-file-settings-and-command-line-options-mapping"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> The following table maps the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#std-label-configuration-options"> configuration file </a> settings and the related <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> command-line options. </p> <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> Configuration File Setting </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> Command-Line Options </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-auditLog.auditEncryptionKeyIdentifier"> <code class="leafygreen-ui-1l06pbn"> auditLog.auditEncryptionKeyIdentifier </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--auditEncryptionKeyUID"> <code class="leafygreen-ui-1l06pbn"> mongod --auditEncryptionKeyUID </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--auditEncryptionKeyUID"> <code class="leafygreen-ui-1l06pbn"> mongos --auditEncryptionKeyUID </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-auditLog.compressionMode"> <code class="leafygreen-ui-1l06pbn"> auditLog.compressionMode </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--auditCompressionMode"> <code class="leafygreen-ui-1l06pbn"> mongod --auditCompressionMode </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--auditCompressionMode"> <code class="leafygreen-ui-1l06pbn"> mongos --auditCompressionMode </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-auditLog.destination"> <code class="leafygreen-ui-1l06pbn"> auditLog.destination </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--auditDestination"> <code class="leafygreen-ui-1l06pbn"> mongod --auditDestination </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--auditDestination"> <code class="leafygreen-ui-1l06pbn"> mongos --auditDestination </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-auditLog.filter"> <code class="leafygreen-ui-1l06pbn"> auditLog.filter </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--auditFilter"> <code class="leafygreen-ui-1l06pbn"> mongod --auditFilter </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--auditFilter"> <code class="leafygreen-ui-1l06pbn"> mongos --auditFilter </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-auditLog.format"> <code class="leafygreen-ui-1l06pbn"> auditLog.format </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--auditFormat"> <code class="leafygreen-ui-1l06pbn"> mongod --auditFormat </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--auditFormat"> <code class="leafygreen-ui-1l06pbn"> mongos --auditFormat </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-auditLog.localAuditKeyFile"> <code class="leafygreen-ui-1l06pbn"> auditLog.localAuditKeyFile </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--auditLocalKeyFile"> <code class="leafygreen-ui-1l06pbn"> mongod --auditLocalKeyFile </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--auditLocalKeyFile"> <code class="leafygreen-ui-1l06pbn"> mongos --auditLocalKeyFile </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-auditLog.path"> <code class="leafygreen-ui-1l06pbn"> auditLog.path </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--auditPath"> <code class="leafygreen-ui-1l06pbn"> mongod --auditPath </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--auditPath"> <code class="leafygreen-ui-1l06pbn"> mongos --auditPath </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-auditLog.schema"> <code class="leafygreen-ui-1l06pbn"> auditLog.schema </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--auditSchema"> <code class="leafygreen-ui-1l06pbn"> mongod --auditSchema </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--auditSchema"> <code class="leafygreen-ui-1l06pbn"> mongos --auditSchema </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--bind_ip"> <code class="leafygreen-ui-1l06pbn"> mongod --bind_ip </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--bind_ip"> <code class="leafygreen-ui-1l06pbn"> mongos --bind_ip </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIpAll"> <code class="leafygreen-ui-1l06pbn"> net.bindIpAll </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--bind_ip_all"> <code class="leafygreen-ui-1l06pbn"> mongod --bind_ip_all </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--bind_ip_all"> <code class="leafygreen-ui-1l06pbn"> mongos --bind_ip_all </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.compression.compressors"> <code class="leafygreen-ui-1l06pbn"> net.compression.compressors </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--networkMessageCompressors"> <code class="leafygreen-ui-1l06pbn"> mongod --networkMessageCompressors </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--networkMessageCompressors"> <code class="leafygreen-ui-1l06pbn"> mongos --networkMessageCompressors </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.ipv6"> <code class="leafygreen-ui-1l06pbn"> net.ipv6 </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--ipv6"> <code class="leafygreen-ui-1l06pbn"> mongod --ipv6 </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--ipv6"> <code class="leafygreen-ui-1l06pbn"> mongos --ipv6 </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.maxIncomingConnections"> <code class="leafygreen-ui-1l06pbn"> net.maxIncomingConnections </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--maxConns"> <code class="leafygreen-ui-1l06pbn"> mongod --maxConns </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--maxConns"> <code class="leafygreen-ui-1l06pbn"> mongos --maxConns </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.port"> <code class="leafygreen-ui-1l06pbn"> net.port </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--port"> <code class="leafygreen-ui-1l06pbn"> mongod --port </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--port"> <code class="leafygreen-ui-1l06pbn"> mongos --port </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.allowConnectionsWithoutCertificates"> <code class="leafygreen-ui-1l06pbn"> net.tls.allowConnectionsWithoutCertificates </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsAllowConnectionsWithoutCertificates"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsAllowConnectionsWithoutCertificates </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsAllowConnectionsWithoutCertificates"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsAllowConnectionsWithoutCertificates </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.allowInvalidCertificates"> <code class="leafygreen-ui-1l06pbn"> net.tls.allowInvalidCertificates </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsAllowInvalidCertificates"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsAllowInvalidCertificates </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsAllowInvalidCertificates"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsAllowInvalidCertificates </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.allowInvalidHostnames"> <code class="leafygreen-ui-1l06pbn"> net.tls.allowInvalidHostnames </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsAllowInvalidHostnames"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsAllowInvalidHostnames </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsAllowInvalidHostnames"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsAllowInvalidHostnames </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.CAFile"> <code class="leafygreen-ui-1l06pbn"> net.tls.CAFile </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsCAFile"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsCAFile </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsCAFile"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsCAFile </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.clusterCAFile"> <code class="leafygreen-ui-1l06pbn"> net.tls.clusterCAFile </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsClusterCAFile"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsClusterCAFile </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsClusterCAFile"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsClusterCAFile </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.certificateSelector"> <code class="leafygreen-ui-1l06pbn"> net.tls.certificateSelector </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsCertificateSelector"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsCertificateSelector </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsCertificateSelector"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsCertificateSelector </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.clusterCertificateSelector"> <code class="leafygreen-ui-1l06pbn"> net.tls.clusterCertificateSelector </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsClusterCertificateSelector"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsClusterCertificateSelector </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsClusterCertificateSelector"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsClusterCertificateSelector </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.clusterFile"> <code class="leafygreen-ui-1l06pbn"> net.tls.clusterFile </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsClusterFile"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsClusterFile </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsClusterFile"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsClusterFile </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.clusterPassword"> <code class="leafygreen-ui-1l06pbn"> net.tls.clusterPassword </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsClusterPassword"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsClusterPassword </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsClusterPassword"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsClusterPassword </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.CRLFile"> <code class="leafygreen-ui-1l06pbn"> net.tls.CRLFile </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsCRLFile"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsCRLFile </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsCRLFile"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsCRLFile </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.disabledProtocols"> <code class="leafygreen-ui-1l06pbn"> net.tls.disabledProtocols </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsDisabledProtocols"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsDisabledProtocols </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsDisabledProtocols"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsDisabledProtocols </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.FIPSMode"> <code class="leafygreen-ui-1l06pbn"> net.tls.FIPSMode </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsFIPSMode"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsFIPSMode </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsFIPSMode"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsFIPSMode </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.mode"> <code class="leafygreen-ui-1l06pbn"> net.tls.mode </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsMode"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsMode </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsMode"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsMode </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.certificateKeyFile"> <code class="leafygreen-ui-1l06pbn"> net.tls.certificateKeyFile </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsCertificateKeyFile"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsCertificateKeyFile </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsCertificateKeyFile"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsCertificateKeyFile </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.certificateKeyFilePassword"> <code class="leafygreen-ui-1l06pbn"> net.tls.certificateKeyFilePassword </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--tlsCertificateKeyFilePassword"> <code class="leafygreen-ui-1l06pbn"> mongod --tlsCertificateKeyFilePassword </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--tlsCertificateKeyFilePassword"> <code class="leafygreen-ui-1l06pbn"> mongos --tlsCertificateKeyFilePassword </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> net.ssl.sslOnNormalPorts </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <code class="leafygreen-ui-1l06pbn"> --sslOnNormalPorts </code> </div> <div class="line"> <code class="leafygreen-ui-1l06pbn"> --sslOnNormalPorts </code> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.unixDomainSocket.enabled"> <code class="leafygreen-ui-1l06pbn"> net.unixDomainSocket.enabled </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--nounixsocket"> <code class="leafygreen-ui-1l06pbn"> mongod --nounixsocket </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--nounixsocket"> <code class="leafygreen-ui-1l06pbn"> mongos --nounixsocket </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.unixDomainSocket.filePermissions"> <code class="leafygreen-ui-1l06pbn"> net.unixDomainSocket.filePermissions </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--filePermissions"> <code class="leafygreen-ui-1l06pbn"> mongod --filePermissions </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--filePermissions"> <code class="leafygreen-ui-1l06pbn"> mongos --filePermissions </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.unixDomainSocket.pathPrefix"> <code class="leafygreen-ui-1l06pbn"> net.unixDomainSocket.pathPrefix </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--unixSocketPrefix"> <code class="leafygreen-ui-1l06pbn"> mongod --unixSocketPrefix </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--unixSocketPrefix"> <code class="leafygreen-ui-1l06pbn"> mongos --unixSocketPrefix </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.wireObjectCheck"> <code class="leafygreen-ui-1l06pbn"> net.wireObjectCheck </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-operationProfiling.mode"> <code class="leafygreen-ui-1l06pbn"> operationProfiling.mode </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--profile"> <code class="leafygreen-ui-1l06pbn"> mongod --profile </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-operationProfiling.slowOpSampleRate"> <code class="leafygreen-ui-1l06pbn"> operationProfiling.slowOpSampleRate </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--slowOpSampleRate"> <code class="leafygreen-ui-1l06pbn"> mongod --slowOpSampleRate </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--slowOpSampleRate"> <code class="leafygreen-ui-1l06pbn"> mongos --slowOpSampleRate </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-operationProfiling.slowOpThresholdMs"> <code class="leafygreen-ui-1l06pbn"> operationProfiling.slowOpThresholdMs </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--slowms"> <code class="leafygreen-ui-1l06pbn"> mongod --slowms </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--slowms"> <code class="leafygreen-ui-1l06pbn"> mongos --slowms </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-processManagement.fork"> <code class="leafygreen-ui-1l06pbn"> processManagement.fork </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--fork"> <code class="leafygreen-ui-1l06pbn"> mongod --fork </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--fork"> <code class="leafygreen-ui-1l06pbn"> mongos --fork </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-processManagement.pidFilePath"> <code class="leafygreen-ui-1l06pbn"> processManagement.pidFilePath </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--pidfilepath"> <code class="leafygreen-ui-1l06pbn"> mongod --pidfilepath </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--pidfilepath"> <code class="leafygreen-ui-1l06pbn"> mongos --pidfilepath </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-processManagement.timeZoneInfo"> <code class="leafygreen-ui-1l06pbn"> processManagement.timeZoneInfo </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--timeZoneInfo"> <code class="leafygreen-ui-1l06pbn"> mongod --timeZoneInfo </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--timeZoneInfo"> <code class="leafygreen-ui-1l06pbn"> mongos --timeZoneInfo </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-processManagement.windowsService.description"> <code class="leafygreen-ui-1l06pbn"> processManagement.windowsService.description </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod.exe/#std-option-mongod.exe.--serviceDescription"> <code class="leafygreen-ui-1l06pbn"> mongod.exe --serviceDescription </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos.exe/#std-option-mongos.exe.--serviceDescription"> <code class="leafygreen-ui-1l06pbn"> mongos.exe --serviceDescription </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-processManagement.windowsService.displayName"> <code class="leafygreen-ui-1l06pbn"> processManagement.windowsService.displayName </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod.exe/#std-option-mongod.exe.--serviceDisplayName"> <code class="leafygreen-ui-1l06pbn"> mongod.exe --serviceDisplayName </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos.exe/#std-option-mongos.exe.--serviceDisplayName"> <code class="leafygreen-ui-1l06pbn"> mongos.exe --serviceDisplayName </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-processManagement.windowsService.serviceName"> <code class="leafygreen-ui-1l06pbn"> processManagement.windowsService.serviceName </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod.exe/#std-option-mongod.exe.--serviceName"> <code class="leafygreen-ui-1l06pbn"> mongod.exe --serviceName </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos.exe/#std-option-mongos.exe.--serviceName"> <code class="leafygreen-ui-1l06pbn"> mongos.exe --serviceName </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-processManagement.windowsService.servicePassword"> <code class="leafygreen-ui-1l06pbn"> processManagement.windowsService.servicePassword </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod.exe/#std-option-mongod.exe.--servicePassword"> <code class="leafygreen-ui-1l06pbn"> mongod.exe --servicePassword </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos.exe/#std-option-mongos.exe.--servicePassword"> <code class="leafygreen-ui-1l06pbn"> mongos.exe --servicePassword </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-processManagement.windowsService.serviceUser"> <code class="leafygreen-ui-1l06pbn"> processManagement.windowsService.serviceUser </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod.exe/#std-option-mongod.exe.--serviceUser"> <code class="leafygreen-ui-1l06pbn"> mongod.exe --serviceUser </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos.exe/#std-option-mongos.exe.--serviceUser"> <code class="leafygreen-ui-1l06pbn"> mongos.exe --serviceUser </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.enableMajorityReadConcern"> <code class="leafygreen-ui-1l06pbn"> replication.enableMajorityReadConcern </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--enableMajorityReadConcern"> <code class="leafygreen-ui-1l06pbn"> mongod --enableMajorityReadConcern </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.localPingThresholdMs"> <code class="leafygreen-ui-1l06pbn"> replication.localPingThresholdMs </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--localThreshold"> <code class="leafygreen-ui-1l06pbn"> mongos --localThreshold </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.oplogSizeMB"> <code class="leafygreen-ui-1l06pbn"> replication.oplogSizeMB </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--oplogSize"> <code class="leafygreen-ui-1l06pbn"> mongod --oplogSize </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--replSet"> <code class="leafygreen-ui-1l06pbn"> mongod --replSet </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.authorization"> <code class="leafygreen-ui-1l06pbn"> security.authorization </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--auth"> <code class="leafygreen-ui-1l06pbn"> mongod --auth </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--noauth"> <code class="leafygreen-ui-1l06pbn"> mongod --noauth </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.clusterAuthMode"> <code class="leafygreen-ui-1l06pbn"> security.clusterAuthMode </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--clusterAuthMode"> <code class="leafygreen-ui-1l06pbn"> mongod --clusterAuthMode </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--clusterAuthMode"> <code class="leafygreen-ui-1l06pbn"> mongos --clusterAuthMode </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.enableEncryption"> <code class="leafygreen-ui-1l06pbn"> security.enableEncryption </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--enableEncryption"> <code class="leafygreen-ui-1l06pbn"> mongod --enableEncryption </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.encryptionCipherMode"> <code class="leafygreen-ui-1l06pbn"> security.encryptionCipherMode </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--encryptionCipherMode"> <code class="leafygreen-ui-1l06pbn"> mongod --encryptionCipherMode </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.encryptionKeyFile"> <code class="leafygreen-ui-1l06pbn"> security.encryptionKeyFile </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--encryptionKeyFile"> <code class="leafygreen-ui-1l06pbn"> mongod --encryptionKeyFile </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.javascriptEnabled"> <code class="leafygreen-ui-1l06pbn"> security.javascriptEnabled </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--noscripting"> <code class="leafygreen-ui-1l06pbn"> mongod --noscripting </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--noscripting"> <code class="leafygreen-ui-1l06pbn"> mongos --noscripting </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.keyFile"> <code class="leafygreen-ui-1l06pbn"> security.keyFile </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--keyFile"> <code class="leafygreen-ui-1l06pbn"> mongod --keyFile </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--keyFile"> <code class="leafygreen-ui-1l06pbn"> mongos --keyFile </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.kmip.clientCertificateFile"> <code class="leafygreen-ui-1l06pbn"> security.kmip.clientCertificateFile </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipClientCertificateFile"> <code class="leafygreen-ui-1l06pbn"> mongod --kmipClientCertificateFile </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.kmip.clientCertificatePassword"> <code class="leafygreen-ui-1l06pbn"> security.kmip.clientCertificatePassword </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipClientCertificatePassword"> <code class="leafygreen-ui-1l06pbn"> mongod --kmipClientCertificatePassword </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.kmip.clientCertificateSelector"> <code class="leafygreen-ui-1l06pbn"> security.kmip.clientCertificateSelector </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipClientCertificateSelector"> <code class="leafygreen-ui-1l06pbn"> mongod --kmipClientCertificateSelector </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.kmip.connectRetries"> <code class="leafygreen-ui-1l06pbn"> security.kmip.connectRetries </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipConnectRetries"> <code class="leafygreen-ui-1l06pbn"> mongod --kmipConnectRetries </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.kmip.connectTimeoutMS"> <code class="leafygreen-ui-1l06pbn"> security.kmip.connectTimeoutMS </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipConnectTimeoutMS"> <code class="leafygreen-ui-1l06pbn"> mongod --kmipConnectTimeoutMS </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.kmip.keyIdentifier"> <code class="leafygreen-ui-1l06pbn"> security.kmip.keyIdentifier </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipKeyIdentifier"> <code class="leafygreen-ui-1l06pbn"> mongod --kmipKeyIdentifier </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.kmip.port"> <code class="leafygreen-ui-1l06pbn"> security.kmip.port </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipPort"> <code class="leafygreen-ui-1l06pbn"> mongod --kmipPort </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.kmip.rotateMasterKey"> <code class="leafygreen-ui-1l06pbn"> security.kmip.rotateMasterKey </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipRotateMasterKey"> <code class="leafygreen-ui-1l06pbn"> mongod --kmipRotateMasterKey </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.kmip.serverCAFile"> <code class="leafygreen-ui-1l06pbn"> security.kmip.serverCAFile </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipServerCAFile"> <code class="leafygreen-ui-1l06pbn"> mongod --kmipServerCAFile </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.kmip.serverName"> <code class="leafygreen-ui-1l06pbn"> security.kmip.serverName </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipServerName"> <code class="leafygreen-ui-1l06pbn"> mongod --kmipServerName </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.kmip.activateKeys"> <code class="leafygreen-ui-1l06pbn"> security.kmip.activateKeys </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipActivateKeys"> <code class="leafygreen-ui-1l06pbn"> mongod --kmipActivateKeys </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.kmip.keyStatePollingSeconds"> <code class="leafygreen-ui-1l06pbn"> security.kmip.keyStatePollingSeconds </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipKeyStatePollingSeconds"> <code class="leafygreen-ui-1l06pbn"> mongod --kmipKeyStatePollingSeconds </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.authz.queryTemplate"> <code class="leafygreen-ui-1l06pbn"> security.ldap.authz.queryTemplate </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--ldapAuthzQueryTemplate"> <code class="leafygreen-ui-1l06pbn"> mongod --ldapAuthzQueryTemplate </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.bind.method"> <code class="leafygreen-ui-1l06pbn"> security.ldap.bind.method </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--ldapBindMethod"> <code class="leafygreen-ui-1l06pbn"> mongod --ldapBindMethod </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--ldapBindMethod"> <code class="leafygreen-ui-1l06pbn"> mongos --ldapBindMethod </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.bind.queryPassword"> <code class="leafygreen-ui-1l06pbn"> security.ldap.bind.queryPassword </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--ldapQueryPassword"> <code class="leafygreen-ui-1l06pbn"> mongod --ldapQueryPassword </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--ldapQueryPassword"> <code class="leafygreen-ui-1l06pbn"> mongos --ldapQueryPassword </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.bind.queryUser"> <code class="leafygreen-ui-1l06pbn"> security.ldap.bind.queryUser </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--ldapQueryUser"> <code class="leafygreen-ui-1l06pbn"> mongod --ldapQueryUser </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--ldapQueryUser"> <code class="leafygreen-ui-1l06pbn"> mongos --ldapQueryUser </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.bind.saslMechanisms"> <code class="leafygreen-ui-1l06pbn"> security.ldap.bind.saslMechanisms </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--ldapBindSaslMechanisms"> <code class="leafygreen-ui-1l06pbn"> mongod --ldapBindSaslMechanisms </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--ldapBindSaslMechanisms"> <code class="leafygreen-ui-1l06pbn"> mongos --ldapBindSaslMechanisms </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.bind.useOSDefaults"> <code class="leafygreen-ui-1l06pbn"> security.ldap.bind.useOSDefaults </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--ldapBindWithOSDefaults"> <code class="leafygreen-ui-1l06pbn"> mongod --ldapBindWithOSDefaults </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--ldapBindWithOSDefaults"> <code class="leafygreen-ui-1l06pbn"> mongos --ldapBindWithOSDefaults </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.retryCount"> <code class="leafygreen-ui-1l06pbn"> security.ldap.retryCount </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--ldapRetryCount"> <code class="leafygreen-ui-1l06pbn"> mongod --ldapRetryCount </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--ldapRetryCount"> <code class="leafygreen-ui-1l06pbn"> mongos --ldapRetryCount </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.servers"> <code class="leafygreen-ui-1l06pbn"> security.ldap.servers </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--ldapServers"> <code class="leafygreen-ui-1l06pbn"> mongod --ldapServers </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--ldapServers"> <code class="leafygreen-ui-1l06pbn"> mongos --ldapServers </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.timeoutMS"> <code class="leafygreen-ui-1l06pbn"> security.ldap.timeoutMS </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--ldapTimeoutMS"> <code class="leafygreen-ui-1l06pbn"> mongod --ldapTimeoutMS </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--ldapTimeoutMS"> <code class="leafygreen-ui-1l06pbn"> mongos --ldapTimeoutMS </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.transportSecurity"> <code class="leafygreen-ui-1l06pbn"> security.ldap.transportSecurity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--ldapTransportSecurity"> <code class="leafygreen-ui-1l06pbn"> mongod --ldapTransportSecurity </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--ldapTransportSecurity"> <code class="leafygreen-ui-1l06pbn"> mongos --ldapTransportSecurity </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.userToDNMapping"> <code class="leafygreen-ui-1l06pbn"> security.ldap.userToDNMapping </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--ldapUserToDNMapping"> <code class="leafygreen-ui-1l06pbn"> mongod --ldapUserToDNMapping </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--ldapUserToDNMapping"> <code class="leafygreen-ui-1l06pbn"> mongos --ldapUserToDNMapping </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.redactClientLogData"> <code class="leafygreen-ui-1l06pbn"> security.redactClientLogData </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--redactClientLogData"> <code class="leafygreen-ui-1l06pbn"> mongod --redactClientLogData </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--redactClientLogData"> <code class="leafygreen-ui-1l06pbn"> mongos --redactClientLogData </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.sasl.hostName"> <code class="leafygreen-ui-1l06pbn"> security.sasl.hostName </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter saslHostName=... </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter saslHostName=... </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.sasl.saslauthdSocketPath"> <code class="leafygreen-ui-1l06pbn"> security.sasl.saslauthdSocketPath </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter saslauthdPath=... </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter saslauthdPath=... </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.sasl.serviceName"> <code class="leafygreen-ui-1l06pbn"> security.sasl.serviceName </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter saslServiceName=... </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter saslServiceName=... </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.transitionToAuth"> <code class="leafygreen-ui-1l06pbn"> security.transitionToAuth </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--transitionToAuth"> <code class="leafygreen-ui-1l06pbn"> mongod --transitionToAuth </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--transitionToAuth"> <code class="leafygreen-ui-1l06pbn"> mongos --transitionToAuth </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-sharding.clusterRole"> <code class="leafygreen-ui-1l06pbn"> sharding.clusterRole </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--shardsvr"> <code class="leafygreen-ui-1l06pbn"> mongod --shardsvr </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--configsvr"> <code class="leafygreen-ui-1l06pbn"> mongod --configsvr </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-sharding.configDB"> <code class="leafygreen-ui-1l06pbn"> sharding.configDB </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--configdb"> <code class="leafygreen-ui-1l06pbn"> mongos --configdb </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> storage.dbPath </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--dbpath"> <code class="leafygreen-ui-1l06pbn"> mongod --dbpath </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.directoryPerDB"> <code class="leafygreen-ui-1l06pbn"> storage.directoryPerDB </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--directoryperdb"> <code class="leafygreen-ui-1l06pbn"> mongod --directoryperdb </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.engine"> <code class="leafygreen-ui-1l06pbn"> storage.engine </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--storageEngine"> <code class="leafygreen-ui-1l06pbn"> mongod --storageEngine </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.inMemory.engineConfig.inMemorySizeGB"> <code class="leafygreen-ui-1l06pbn"> storage.inMemory.engineConfig.inMemorySizeGB </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--inMemorySizeGB"> <code class="leafygreen-ui-1l06pbn"> mongod --inMemorySizeGB </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.journal.commitIntervalMs"> <code class="leafygreen-ui-1l06pbn"> storage.journal.commitIntervalMs </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--journalCommitInterval"> <code class="leafygreen-ui-1l06pbn"> mongod --journalCommitInterval </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.syncPeriodSecs"> <code class="leafygreen-ui-1l06pbn"> storage.syncPeriodSecs </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--syncdelay"> <code class="leafygreen-ui-1l06pbn"> mongod --syncdelay </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.wiredTiger.collectionConfig.blockCompressor"> <code class="leafygreen-ui-1l06pbn"> storage.wiredTiger.collectionConfig.blockCompressor </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--wiredTigerCollectionBlockCompressor"> <code class="leafygreen-ui-1l06pbn"> mongod --wiredTigerCollectionBlockCompressor </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.wiredTiger.engineConfig.cacheSizeGB"> <code class="leafygreen-ui-1l06pbn"> storage.wiredTiger.engineConfig.cacheSizeGB </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--wiredTigerCacheSizeGB"> <code class="leafygreen-ui-1l06pbn"> mongod --wiredTigerCacheSizeGB </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.wiredTiger.engineConfig.directoryForIndexes"> <code class="leafygreen-ui-1l06pbn"> storage.wiredTiger.engineConfig.directoryForIndexes </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--wiredTigerDirectoryForIndexes"> <code class="leafygreen-ui-1l06pbn"> mongod --wiredTigerDirectoryForIndexes </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.wiredTiger.engineConfig.journalCompressor"> <code class="leafygreen-ui-1l06pbn"> storage.wiredTiger.engineConfig.journalCompressor </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--wiredTigerJournalCompressor"> <code class="leafygreen-ui-1l06pbn"> mongod --wiredTigerJournalCompressor </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.wiredTiger.indexConfig.prefixCompression"> <code class="leafygreen-ui-1l06pbn"> storage.wiredTiger.indexConfig.prefixCompression </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--wiredTigerIndexPrefixCompression"> <code class="leafygreen-ui-1l06pbn"> mongod --wiredTigerIndexPrefixCompression </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.accessControl.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.accessControl.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={accessControl: ... }" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={accessControl: ... }" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.command.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.command.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={command: ... }" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={command: ... }" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.control.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.control.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={control: ... }" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={control: ... }" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.ftdc.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.ftdc.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={ftdc: ... }" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={ftdc: ... }" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.geo.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.geo.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={geo: ... }" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={geo: ... }" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.index.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.index.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={index: ... }" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={index: ... }" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.network.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.network.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={network: ... }" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={network: ... }" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.query.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.query.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={query: ... }" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={query: ... }" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.replication.heartbeats.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.replication.heartbeats.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={replication: {heartbeats: ... }}" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={replication: {heartbeats: ... }}" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.replication.rollback.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.replication.rollback.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={replication: {rollback: ... }}" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={replication: {rollback: ... }}" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.replication.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.replication.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={replication: ... }" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={replication: ... }" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.sharding.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.sharding.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={sharding: ... }" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={sharding: ... }" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.storage.journal.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.storage.journal.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={storage: {journal: ... }}" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={storage: {journal: ... }}" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.storage.recovery.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.storage.recovery.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={storage: {recovery: ... }}" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={storage: {recovery: ... }}" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.storage.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.storage.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={storage: ... }" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={storage: ... }" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.component.write.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.component.write.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongod --setParameter "logComponentVerbosity={write: ... }" </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--setParameter"> <code class="leafygreen-ui-1l06pbn"> mongos --setParameter "logComponentVerbosity={write: ... }" </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.destination"> <code class="leafygreen-ui-1l06pbn"> systemLog.destination </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--logpath"> <code class="leafygreen-ui-1l06pbn"> mongod --logpath </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--logpath"> <code class="leafygreen-ui-1l06pbn"> mongos --logpath </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--syslog"> <code class="leafygreen-ui-1l06pbn"> mongod --syslog </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--syslog"> <code class="leafygreen-ui-1l06pbn"> mongos --syslog </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.logAppend"> <code class="leafygreen-ui-1l06pbn"> systemLog.logAppend </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--logappend"> <code class="leafygreen-ui-1l06pbn"> mongod --logappend </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--logappend"> <code class="leafygreen-ui-1l06pbn"> mongos --logappend </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.logRotate"> <code class="leafygreen-ui-1l06pbn"> systemLog.logRotate </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--logRotate"> <code class="leafygreen-ui-1l06pbn"> mongod --logRotate </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--logRotate"> <code class="leafygreen-ui-1l06pbn"> mongos --logRotate </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.path"> <code class="leafygreen-ui-1l06pbn"> systemLog.path </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--logpath"> <code class="leafygreen-ui-1l06pbn"> mongod --logpath </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--logpath"> <code class="leafygreen-ui-1l06pbn"> mongos --logpath </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.quiet"> <code class="leafygreen-ui-1l06pbn"> systemLog.quiet </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--quiet"> <code class="leafygreen-ui-1l06pbn"> mongod --quiet </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--quiet"> <code class="leafygreen-ui-1l06pbn"> mongos --quiet </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.syslogFacility"> <code class="leafygreen-ui-1l06pbn"> systemLog.syslogFacility </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--syslogFacility"> <code class="leafygreen-ui-1l06pbn"> mongod --syslogFacility </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--syslogFacility"> <code class="leafygreen-ui-1l06pbn"> mongos --syslogFacility </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.timeStampFormat"> <code class="leafygreen-ui-1l06pbn"> systemLog.timeStampFormat </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--timeStampFormat"> <code class="leafygreen-ui-1l06pbn"> mongod --timeStampFormat </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--timeStampFormat"> <code class="leafygreen-ui-1l06pbn"> mongos --timeStampFormat </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.traceAllExceptions"> <code class="leafygreen-ui-1l06pbn"> systemLog.traceAllExceptions </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--traceExceptions"> <code class="leafygreen-ui-1l06pbn"> mongod --traceExceptions </code> </a> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.verbosity"> <code class="leafygreen-ui-1l06pbn"> systemLog.verbosity </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--verbose"> <code class="leafygreen-ui-1l06pbn"> mongod --verbose </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-option-mongos.--verbose"> <code class="leafygreen-ui-1l06pbn"> mongos --verbose </code> </a> </div> </div> </div> </div> </td> </tr> </tbody> </table> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> ChangeLog <a class="headerlink leafygreen-ui-1kepx47" href="#changelog" 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="changelog"> </div> </a> </h2> <dl> <dt> Starting in version 6.1: </dt> <dd class="css-1ufxuu7"> MongoDB always enables journaling. As a result, MongoDB removes the <code class="leafygreen-ui-1l06pbn"> storage.journal.enabled </code> option and the corresponding <code class="leafygreen-ui-1l06pbn"> --journal </code> and <code class="leafygreen-ui-1l06pbn"> --nojournal </code> command-line options. </dd> <dt> Starting in version 5.0: </dt> <dd class="css-1ufxuu7"> <p class="leafygreen-ui-1kp3ins"> MongoDB removes the <code class="leafygreen-ui-1l06pbn"> --serviceExecutor </code> command-line option and the corresponding <code class="leafygreen-ui-1l06pbn"> net.serviceExecutor </code> configuration option. </p> <p class="leafygreen-ui-1kp3ins"> For earlier versions of MongoDB, refer to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/legacy/?site=docs" target="_self"> <span> legacy documentation </span> </a> . </p> </dd> </dl> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-community-with-docker/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Install MongoDB Community with Docker <a class="headerlink leafygreen-ui-1kepx47" href="#install-mongodb-community-with-docker" 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="install-mongodb-community-with-docker"> </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="#about-this-task" target="_self"> <span> About This Task </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#before-you-begin" target="_self"> <span> Before You Begin </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#procedure" target="_self"> <span> Procedure </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#next-steps--optional-" target="_self"> <span> Next Steps (Optional) </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> You can run MongoDB community Edition as a Docker container using the official MongoDB Community image. Using a Docker image for running your MongoDB deployment is useful to: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Stand up a deployment quickly. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Help manage configuration files. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Test different features on multiple versions of MongoDB. </p> </li> </ul> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> About This Task <a class="headerlink leafygreen-ui-1kepx47" href="#about-this-task" 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="about-this-task"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> This page describes the Docker install instructions for MongoDB Community edition. The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://hub.docker.com/r/mongodb/mongodb-enterprise-server" rel="noopener noreferrer"> <span> MongoDB Enterprise Docker image </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> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/kubernetes-operator" target="_self"> <span> MongoDB Enterprise Kubernetes Operator </span> </a> are recommended for production deployments and should be used together. For enterprise instructions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-enterprise-with-docker/#std-label-docker-mongodb-enterprise-install"> Install MongoDB Enterprise with Docker <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> This procedure uses the official <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://hub.docker.com/r/mongodb/mongodb-community-server" rel="noopener noreferrer"> <span> MongoDB community image </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> , which is maintained by MongoDB. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A full description of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://docs.docker.com/" rel="noopener noreferrer"> <span> Docker </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> is beyond the scope of this documentation. This page assumes prior knowledge of Docker. </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0+ Docker images require <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/Advanced_Vector_Extensions" rel="noopener noreferrer"> <span> AVX </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> support on your system. If your system does not support AVX, you can use a docker image of MongoDB prior to version 5.0. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Versions of MongoDB prior to 5.0 are EOL'd and no longer supported by MongoDB. These versions should be used for testing purposes only. </p> </div> </div> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Before You Begin <a class="headerlink leafygreen-ui-1kepx47" href="#before-you-begin" 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="before-you-begin"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Install <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://docs.docker.com/install/" rel="noopener noreferrer"> <span> Docker </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> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Install <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/install/" target="_self"> <span> mongosh </span> </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-create-docker-image-community"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#procedure" 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="procedure"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Pull the MongoDB Docker Image"},{"@type":"HowToStep","text":"The -p 27017:27017 in this command maps the container port to the host port.\nThis allows you to connect to MongoDB with a localhost:27017 connection string.To install a specific version of MongoDB, specify the version\nafter the : in the Docker run command. Docker pulls and\nruns the specified version.For example, to run MongoDB 5.0:For a full list of available versions, see\nTags.You can use mongod command-line options\nby appending the command-line options to the docker run command.For example, consider the mongod --replSet docker command-line option:","name":"Run the Image as a Container"},{"@type":"HowToStep","text":"To check the status of your Docker container, run the following\ncommand:The output from the ls command lists the following fields that\ndescribe the running container:Container IDImageCommandCreatedStatusPortNames","name":"Check that the Container is Running"},{"@type":"HowToStep","text":"Connect to the MongoDB Deployment with mongosh"},{"@type":"HowToStep","text":"To confirm your MongoDB instance is running, run the Hello\ncommand:The result of this command returns a document describing your\nmongod deployment:","name":"Validate Your Deployment"}],"name":"Procedure","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Pull the MongoDB Docker Image <a class="headerlink leafygreen-ui-1kepx47" href="#pull-the-mongodb-docker-image" 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="pull-the-mongodb-docker-image"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"docker pull mongodb/mongodb-community-server:latest","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">docker pull mongodb/mongodb-community-server:latest</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Run the Image as a Container <a class="headerlink leafygreen-ui-1kepx47" href="#run-the-image-as-a-container" 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="run-the-image-as-a-container"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"docker run --name mongodb -p 27017:27017 -d mongodb/mongodb-community-server:latest","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">docker run --name mongodb -p 27017:27017 -d mongodb/mongodb-community-server:latest</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 <code class="leafygreen-ui-1l06pbn"> -p 27017:27017 </code> in this command maps the container port to the host port. This allows you to connect to MongoDB with a <code class="leafygreen-ui-1l06pbn"> localhost:27017 </code> connection string. </p> <p class="leafygreen-ui-1kp3ins"> To install a specific version of MongoDB, specify the version after the <code class="leafygreen-ui-1l06pbn"> : </code> in the Docker run command. Docker pulls and runs the specified version. </p> <p class="leafygreen-ui-1kp3ins"> For example, to run MongoDB 5.0: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"docker run --name mongodb -p 27017:27017 -d mongodb/mongodb-community-server:5.0-ubuntu2004","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">docker run --name mongodb -p 27017:27017 -d mongodb/mongodb-community-server:5.0-ubuntu2004</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For a full list of available versions, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://hub.docker.com/r/mongodb/mongodb-community-server/tags" rel="noopener noreferrer"> <span> Tags <!-- --> . </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Add Command Line Options </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-file-settings-command-line-options-mapping/#std-label-conf-file-command-line-mapping"> mongod command-line options </a> by appending the command-line options to the docker run command. </p> <p class="leafygreen-ui-1kp3ins"> For example, consider the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--replSet"> <code class="leafygreen-ui-1l06pbn"> mongod --replSet </code> </a> docker command-line option: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"docker run -p 27017:27017 -d mongodb/mongodb-community-server:latest --name mongodb --replSet myReplicaSet","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">docker run -p 27017:27017 -d mongodb<!-- -->/mongodb-community-server<!-- -->:latest --name mongodb --replSet myReplicaSet</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Check that the Container is Running <a class="headerlink leafygreen-ui-1kepx47" href="#check-that-the-container-is-running" 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="check-that-the-container-is-running"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To check the status of your Docker container, run the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"docker container ls","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">docker container ls</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 output from the <code class="leafygreen-ui-1l06pbn"> ls </code> command lists the following fields that describe the running container: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> Container ID </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> Image </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> Command </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> Created </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> Status </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> Port </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> Names </code> </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\nc29db5687290 mongodb/mongodb-community-server:5.0-ubi8 \"docker-entrypoint.s…\" 4 seconds ago Up 3 seconds 27017/tcp mongo","programmingLanguage":"Shell"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</td></tr><tr class=""><td class="leafygreen-ui-7razhx">c29db5687290 mongodb/mongodb-community-server:5.0-ubi8 "docker-entrypoint.s…" 4 seconds ago Up 3 seconds 27017/tcp mongo</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Connect to the MongoDB Deployment with <code class="leafygreen-ui-1l06pbn"> mongosh </code> <a class="headerlink leafygreen-ui-1kepx47" href="#connect-to-the-mongodb-deployment-with-mongosh" 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="connect-to-the-mongodb-deployment-with-mongosh"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh --port 27017","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh --port 27017</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Validate Your Deployment <a class="headerlink leafygreen-ui-1kepx47" href="#validate-your-deployment" 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="validate-your-deployment"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To confirm your MongoDB instance is running, run the <code class="leafygreen-ui-1l06pbn"> Hello </code> command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand(\n {\n hello: 1\n }\n)","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.runCommand(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> hello: 1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The result of this command returns a document describing your <code class="leafygreen-ui-1l06pbn"> mongod </code> deployment: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n isWritablePrimary: true,\n topologyVersion: {\n processId: ObjectId(\"63c00e27195285e827d48908\"),\n counter: Long(\"0\")\n},\n maxBsonObjectSize: 16777216,\n maxMessageSizeBytes: 48000000,\n maxWriteBatchSize: 100000,\n localTime: ISODate(\"2023-01-12T16:51:10.132Z\"),\n logicalSessionTimeoutMinutes: 30,\n connectionId: 18,\n minWireVersion: 0,\n maxWireVersion: 20,\n readOnly: false,\n ok: 1\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">isWritablePrimary</span>: <span class="lg-highlight-literal">true</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">topologyVersion</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">processId</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"63c00e27195285e827d48908"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">counter</span>: <span class="lg-highlight-title lg-highlight-class">Long</span>(<span class="lg-highlight-string">"0"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">maxBsonObjectSize</span>: <span class="lg-highlight-number">16777216</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">maxMessageSizeBytes</span>: <span class="lg-highlight-number">48000000</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">maxWriteBatchSize</span>: <span class="lg-highlight-number">100000</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">localTime</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2023-01-12T16:51:10.132Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">logicalSessionTimeoutMinutes</span>: <span class="lg-highlight-number">30</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">connectionId</span>: <span class="lg-highlight-number">18</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">minWireVersion</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">maxWireVersion</span>: <span class="lg-highlight-number">20</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">readOnly</span>: <span class="lg-highlight-literal">false</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">ok</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Next Steps (Optional) <a class="headerlink leafygreen-ui-1kepx47" href="#next-steps--optional-" 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="next-steps--optional-"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://github.com/sigstore/cosign" rel="noopener noreferrer"> <span> Cosign </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> to verify MongoDB's signature for container images. </p> <p class="leafygreen-ui-1kp3ins"> This procedure is optional. You do not need to verify MongoDB's signature to run MongoDB on Docker or any other containerized platform. </p> <p class="leafygreen-ui-1kp3ins"> To verify MongoDB's container signature, perform the following steps: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"For installation instructions, see the Cosign GitHub repository.","name":"Download and install Cosign"},{"@type":"HowToStep","text":"Download the MongoDB Server container image's public key"},{"@type":"HowToStep","text":"Run the following command to verify the signature by tag:","name":"Verify the signature"}],"name":"Next Steps (Optional)","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Download and install Cosign <a class="headerlink leafygreen-ui-1kepx47" href="#download-and-install-cosign" 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="download-and-install-cosign"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> For installation instructions, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://github.com/sigstore/cosign" rel="noopener noreferrer"> <span> Cosign GitHub repository <!-- --> . </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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Download the MongoDB Server container image's public key <a class="headerlink leafygreen-ui-1kepx47" href="#download-the-mongodb-server-container-image-s-public-key" 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="download-the-mongodb-server-container-image-s-public-key"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"curl https://cosign.mongodb.com/server.pem &gt; server.pem","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">curl https://cosign.mongodb.com/server.pem &gt; server.pem</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Verify the signature <a class="headerlink leafygreen-ui-1kepx47" href="#verify-the-signature" 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="verify-the-signature"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Run the following command to verify the signature by tag: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"COSIGN_REPOSITORY=docker.io/mongodb/signatures cosign verify --private-infrastructure --key=./server.pem docker.io/mongodb/mongodb-community-server:latest","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">COSIGN_REPOSITORY=docker.io/mongodb/signatures cosign verify --private-infrastructure --key=./server.pem docker.io/mongodb/mongodb-community-server:latest</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> </section> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/sh.unshardCollection/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> sh.unshardCollection <a class="headerlink leafygreen-ui-1kepx47" href="#sh.unshardcollection" 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="sh.unshardcollection"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#considerations" target="_self"> <span> Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#requirements" target="_self"> <span> Requirements </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </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"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection( namespace, shardID ) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-sh.unshardCollection" 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-method-sh.unshardCollection"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Unshards an existing sharded collection and moves the collection data onto a single shard. When you unshard a collection, the collection cannot be partitioned across multiple <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard"> shards </a> and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key"> shard key </a> is removed. </p> <div> <p> <em> New <!-- --> in version <!-- --> 8.0 </em> . </p> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> mongosh Method </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page documents 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> method. This is <em> not </em> the documentation for database commands or language-specific drivers, such as Node.js. </p> <p class="leafygreen-ui-1kp3ins"> For the database command, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/unshardCollection/#mongodb-dbcommand-dbcmd.unshardCollection"> <code class="leafygreen-ui-1l06pbn"> unshardCollection </code> </a> command <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB API drivers, refer to the language-specific <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB driver documentation <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection </code> method requires you to specify the shard to receive the collection data. With the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/unshardCollection/#mongodb-dbcommand-dbcmd.unshardCollection"> <code class="leafygreen-ui-1l06pbn"> unshardCollection </code> </a> command, if you don't specify the destination shard, the cluster automatically selects the shard with the least data. </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"> Unsharding a collection is a write-intensive operation that can result in an increased <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> growth rate. To help mitigate this, consider the following configuration changes: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To prevent unbounded oplog growth, set a fixed oplog size. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To reduce the chance of secondaries becoming stale, increase the oplog size. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For more details, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-oplog/#std-label-replica-set-oplog"> Replica Set Oplog <!-- --> . </a> </p> </div> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection </code> has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.unshardCollection( namespace, shardID )"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.unshardCollection( namespace, shardID )</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> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Parameters <a class="headerlink leafygreen-ui-1kepx47" href="#parameters" 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="parameters"> </div> </a> </h3> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> namespace </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the database and collection to unshard. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> shardID </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the recipient shard ID. As MongoDB unshards the collection, it moves the collection data from their current shards to this specific shard. </div> </div> </td> </tr> </tbody> </table> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This method is available in deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> <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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <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 command cannot be run on shared or serverless instances. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#considerations" 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="considerations"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection() </code> can only be run on sharded clusters. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection() </code> can only operate on sharded collections. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection() </code> can only operate on a single collection at a time. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection() </code> has a 5 minute minimum duration. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You must rebuild Atlas Search indexes after <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection() </code> runs. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot make topology changes, such as adding or removing shards or transitioning between embedded and dedicated config servers, until <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection() </code> completes. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot run the following operations on the collection that is being unsharded while <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection() </code> is in progress: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/convertToCapped/#mongodb-dbcommand-dbcmd.convertToCapped"> <code class="leafygreen-ui-1l06pbn"> convertToCapped </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createIndexes/#mongodb-dbcommand-dbcmd.createIndexes"> <code class="leafygreen-ui-1l06pbn"> createIndexes </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndexes/#mongodb-method-db.collection.createIndexes"> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/drop/#mongodb-dbcommand-dbcmd.drop"> <code class="leafygreen-ui-1l06pbn"> drop </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.drop/#mongodb-method-db.collection.drop"> <code class="leafygreen-ui-1l06pbn"> db.collection.drop() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dropIndexes/#mongodb-dbcommand-dbcmd.dropIndexes"> <code class="leafygreen-ui-1l06pbn"> dropIndexes </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.dropIndex/#mongodb-method-db.collection.dropIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/renameCollection/#mongodb-dbcommand-dbcmd.renameCollection"> <code class="leafygreen-ui-1l06pbn"> renameCollection </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.renameCollection/#mongodb-method-db.collection.renameCollection"> <code class="leafygreen-ui-1l06pbn"> db.collection.renameCollection() </code> </a> </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot run the following operations on the cluster while <code class="leafygreen-ui-1l06pbn"> unshardCollection </code> is in progress: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/addShard/#mongodb-dbcommand-dbcmd.addShard"> <code class="leafygreen-ui-1l06pbn"> addShard </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/removeShard/#mongodb-dbcommand-dbcmd.removeShard"> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <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> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dropDatabase/#mongodb-dbcommand-dbcmd.dropDatabase"> <code class="leafygreen-ui-1l06pbn"> dropDatabase </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/transitionToDedicatedConfigServer/#mongodb-dbcommand-dbcmd.transitionToDedicatedConfigServer"> <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/transitionFromDedicatedConfigServer/#mongodb-dbcommand-dbcmd.transitionFromDedicatedConfigServer"> <code class="leafygreen-ui-1l06pbn"> transitionFromDedicatedConfigServer </code> </a> </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Index builds that occur while <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection() </code> is in progress might silently fail. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Do not create indexes while <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection() </code> is in progress. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Do not call <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection() </code> if there are ongoing index builds. </p> </li> </ul> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Requirements <a class="headerlink leafygreen-ui-1kepx47" href="#requirements" 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="requirements"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Before you unshard your collection, ensure that you meet the following requirements: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your application can tolerate a period of <strong> two seconds </strong> where the affected collection blocks writes. During the time period where writes are blocked, your application experiences an increase in latency. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your database meets these resource requirements: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Ensure the shard you are moving the collection to has enough storage space for the collection and its indexes. The destination shard requires at least <code class="leafygreen-ui-1l06pbn"> ( Collection storage size + Index Size ) * 2 </code> bytes available. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Ensure that your I/O capacity is below 50%. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Ensure that your CPU load is below 80%. </p> </li> </ul> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" 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="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This example unshards a collection named <code class="leafygreen-ui-1l06pbn"> inventory </code> on the <code class="leafygreen-ui-1l06pbn"> app </code> database to the <code class="leafygreen-ui-1l06pbn"> shard02 </code> shard. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.unshardCollection( \"app.inventory\", \"shard02\" )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">unshardCollection</span>( <span class="lg-highlight-string">"app.inventory"</span>, <span class="lg-highlight-string">"shard02"</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"> To get a list of the available shard IDs, run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.status/#mongodb-method-sh.status"> <code class="leafygreen-ui-1l06pbn"> sh.status() </code> </a> . For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.status/#std-label-sh-status-output-examples"> sh.status() Output <!-- --> . </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> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/unshardCollection/#mongodb-dbcommand-dbcmd.unshardCollection"> <code class="leafygreen-ui-1l06pbn"> unshardCollection </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/unshard-collection/#std-label-unshard-collection-task"> Unshard a Collection </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/listCommands/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> listCommands <a class="headerlink leafygreen-ui-1kepx47" href="#listcommands" 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="listcommands"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> listCommands </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.listCommands" 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-dbcommand-dbcmd.listCommands"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.listCommands" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> listCommands </code> </span> </a> command generates a list of all database commands implemented for the current <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand(\n {\n listCommands: 1\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">listCommands</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/Session/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Session <a class="headerlink leafygreen-ui-1kepx47" href="#session" 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="session"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> Session </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-Session" 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-method-Session"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The Session object for the connection 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> . To instantiate a session for the connection 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> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo.startSession/#mongodb-method-Mongo.startSession"> <code class="leafygreen-ui-1l06pbn"> Mongo.startSession() </code> </a> . For more information on sessions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-isolation-consistency-recency/#std-label-sessions"> Client Sessions and Causal Consistency Guarantees <!-- --> . </a> </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> General Session Methods <a class="headerlink leafygreen-ui-1kepx47" href="#general-session-methods" 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="general-session-methods"> </div> </a> </h3> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Method </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Description </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> Session.advanceClusterTime() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-Session.advanceClusterTime" 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-method-Session.advanceClusterTime"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Updates the cluster time tracked by the session. </p> <p class="leafygreen-ui-1kp3ins"> This method has the following parameters: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"Session.advanceClusterTime( {\n clusterTime: &lt;timestamp&gt;,\n signature:\n { hash: &lt;bindata&gt;, keyId: &lt;numberlong&gt; }\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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"><span class="lg-highlight-title lg-highlight-class">Session</span>.<span class="lg-highlight-title lg-highlight-function">advanceClusterTime</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">clusterTime</span>: &lt;<!-- -->timestamp<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">signature</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">hash</span>: &lt;<span class="lg-highlight-title lg-highlight-class">BinData</span>&gt;<!-- -->,<!-- --> <span class="lg-highlight-attr">keyId</span>: &lt;<span class="lg-highlight-title lg-highlight-class">NumberLong</span>&gt; <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> Session.advanceOperationTime(&lt;timestamp&gt;) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-Session.advanceOperationTime" 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-method-Session.advanceOperationTime"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Updates the operation time. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> Session.endSession() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-Session.endSession" 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-method-Session.endSession"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Ends the session. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> Session.getClusterTime() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-Session.getClusterTime" 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-method-Session.getClusterTime"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the most recent cluster time as seen by the session. Applicable for replica sets and sharded clusters only. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> Session.getDatabase(&lt;database&gt;) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-Session.getDatabase" 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-method-Session.getDatabase"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Access the specified database from the session 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> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> Session.getOptions() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-Session.getOptions" 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-method-Session.getOptions"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Access the options for the session. For the available options, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/SessionOptions/#mongodb-method-SessionOptions"> <code class="leafygreen-ui-1l06pbn"> SessionOptions() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> Session.getOperationTime() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-Session.getOperationTime" 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-method-Session.getOperationTime"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the timestamp of the last acknowledged operation for the session. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> Session.hasEnded() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-Session.hasEnded" 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-method-Session.hasEnded"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a boolean that specifies whether the session has ended. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Session Methods for Transactions <a class="headerlink leafygreen-ui-1kepx47" href="#session-methods-for-transactions" 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="session-methods-for-transactions"> </div> </a> </h3> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <thead class="leafygreen-ui-a9ho40"> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Method </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Description </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Session.abortTransaction/#mongodb-method-Session.abortTransaction"> <code class="leafygreen-ui-1l06pbn"> Session.abortTransaction() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Aborts the session's transaction. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Session.abortTransaction/#mongodb-method-Session.abortTransaction"> <code class="leafygreen-ui-1l06pbn"> Session.abortTransaction() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Session.commitTransaction/#mongodb-method-Session.commitTransaction"> <code class="leafygreen-ui-1l06pbn"> Session.commitTransaction() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Commits the session's transaction. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Session.commitTransaction/#mongodb-method-Session.commitTransaction"> <code class="leafygreen-ui-1l06pbn"> Session.commitTransaction() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Session.startTransaction/#mongodb-method-Session.startTransaction"> <code class="leafygreen-ui-1l06pbn"> Session.startTransaction() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Starts a multi-document transaction for the session. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Session.startTransaction/#mongodb-method-Session.startTransaction"> <code class="leafygreen-ui-1l06pbn"> Session.startTransaction() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Session.withTransaction/#mongodb-method-Session.withTransaction"> <code class="leafygreen-ui-1l06pbn"> Session.withTransaction() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Runs a specified lambda function within a transaction. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Session.withTransaction/#mongodb-method-Session.withTransaction"> <code class="leafygreen-ui-1l06pbn"> Session.withTransaction() </code> . </a> </div> </div> </td> </tr> </tbody> </table> </div> </section> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example starts a session on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> connection object associated with <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> 's global <code class="leafygreen-ui-1l06pbn"> db </code> variable, and then uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-Session.getDatabase" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> Session.getDatabase() </code> </span> </a> method to retrieve the database object associated with the session. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var session = db.getMongo().startSession();\ndb = session.getDatabase(db.getName());","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> session <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">getMongo</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">startSession</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db <!-- -->= <!-- -->session.<span class="lg-highlight-title lg-highlight-function">getDatabase</span>(<!-- -->db.<span class="lg-highlight-title lg-highlight-function">getName</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> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/db.collection.createIndexes/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.collection.createIndexes() <a class="headerlink leafygreen-ui-1kepx47" href="#db.collection.createindexes--" 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.collection.createindexes--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#stable-api" target="_self"> <span> Stable API </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#options" target="_self"> <span> Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#options-for-all-index-types" target="_self"> <span> Options for All Index Types </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#option-for-collation" target="_self"> <span> Option for Collation </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#options-for-text-indexes" target="_self"> <span> Options for <code class="css-1kekw28 e1wawog0"> text </code> Indexes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#options-for-2dsphere-indexes" target="_self"> <span> Options for <code class="css-1kekw28 e1wawog0"> 2dsphere </code> Indexes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#options-for-2d-indexes" target="_self"> <span> Options for <code class="css-1kekw28 e1wawog0"> 2d </code> Indexes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#options-for-wildcard-indexes" target="_self"> <span> Options for <code class="css-1kekw28 e1wawog0"> wildcard </code> indexes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behaviors" target="_self"> <span> Behaviors </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#recreating-an-existing-index" target="_self"> <span> Recreating an Existing Index </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#index-options" target="_self"> <span> Index Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#wildcard-indexes" target="_self"> <span> Wildcard Indexes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#transactions" target="_self"> <span> Transactions </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#index-builds" target="_self"> <span> Index Builds </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#create-indexes-without-options" target="_self"> <span> Create Indexes Without Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#create-indexes-with-collation-specified" target="_self"> <span> Create Indexes with Collation Specified </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#create-a-wildcard-index" target="_self"> <span> Create a Wildcard Index </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#create-indexes-with-commit-quorum" target="_self"> <span> Create Indexes With Commit Quorum </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#create-multiple-indexes" target="_self"> <span> Create Multiple Indexes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#additional-information" target="_self"> <span> Additional Information </span> </a> </li> </ul> </div> <div class="leafygreen-ui-147elvs"> <p class="leafygreen-ui-1ronz74"> MongoDB with drivers </p> <div class="leafygreen-ui-18k5rfm"> <p class="leafygreen-ui-1kp3ins"> This page documents 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> method. To see the equivalent method in a MongoDB driver, see the corresponding page for your programming language: </p> </div> <div class="leafygreen-ui-zgrwqu notranslate"> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/drivers/csharp/current/fundamentals/indexes/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_1351_59964)"> <g clip-path="url(#clip1_1351_59964)"> <path d="M25.7709 9.2495C25.7709 8.79827 25.678 8.39408 25.4827 8.04627C25.2874 7.70785 25.0084 7.42586 24.627 7.20025C21.465 5.35781 18.2937 3.51538 15.1317 1.67295C14.2761 1.17474 13.4484 1.19354 12.6021 1.70115C11.3466 2.45316 5.04112 6.10042 3.15321 7.20025C2.3813 7.65142 2 8.34705 2 9.24005C2 12.9531 2 16.6568 2 20.3698C2 20.8117 2.093 21.2064 2.279 21.5449C2.4743 21.8927 2.7626 22.1841 3.15321 22.4191C5.03182 23.5189 11.3373 27.1662 12.6021 27.9182C13.4484 28.4258 14.2761 28.4446 15.1317 27.9463C18.2937 26.1039 21.465 24.2615 24.627 22.4191C25.0177 22.1935 25.306 21.9021 25.5012 21.5449C25.6873 21.2064 25.7803 20.8117 25.7803 20.3698C25.7709 20.3698 25.7709 12.9531 25.7709 9.2495Z" fill="#A179DC"> </path> <path d="M13.9227 14.7673L2.27905 21.5449C2.47435 21.8927 2.76265 22.1841 3.15326 22.4191C5.03187 23.5189 11.3373 27.1662 12.6021 27.9182C13.4484 28.4258 14.2762 28.4445 15.1317 27.9463C18.2938 26.1039 21.4651 24.2615 24.6271 22.4191C25.0177 22.1935 25.306 21.9021 25.5013 21.5449L13.9227 14.7673Z" fill="#280068"> </path> <path d="M25.7711 9.24949C25.7711 8.79827 25.6781 8.39408 25.4828 8.04626L13.9229 14.7768L25.4921 21.5543C25.6781 21.2159 25.7711 20.8211 25.7711 20.3793C25.7711 20.3699 25.7711 12.9531 25.7711 9.24949Z" fill="#390091"> </path> <path d="M20.7771 12.2387V13.5078H22.0325V12.2387H22.6557V13.5078H23.9111V14.1376H22.6557V15.4066H23.9111V16.0364H22.6557V17.3054H22.0325V16.0364H20.7771V17.3054H20.1539V16.0364H18.8984V15.4066H20.1539V14.1376H18.8984V13.5078H20.1539V12.2387H20.7771ZM22.0325 14.1376H20.7771V15.4066H22.0325V14.1376Z" fill="white"> </path> <path d="M13.9508 5.87482C17.2151 5.87482 20.0702 7.67022 21.6047 10.3399L21.5861 10.3117L17.7452 12.5489C16.9919 11.2517 15.5969 10.3775 14.0066 10.3587H13.9601C11.5328 10.3587 9.56116 12.3515 9.56116 14.805C9.56116 15.604 9.77503 16.3654 10.1377 17.014C10.9004 18.3488 12.3232 19.2512 13.9601 19.2512C15.6062 19.2512 17.0384 18.3394 17.7917 16.9858L17.7731 17.014L21.614 19.2606C20.0981 21.9021 17.2895 23.6975 14.0531 23.7257H13.9508C10.6679 23.7257 7.81274 21.9209 6.28753 19.2418C5.54353 17.9352 5.11572 16.4124 5.11572 14.7956C5.11572 9.87931 9.06825 5.87482 13.9508 5.87482Z" fill="white"> </path> </g> </g> <defs> <clippath id="clip0_1351_59964"> <rect fill="white" height="28" transform="translate(0 0.809265)" width="28"> </rect> </clippath> <clippath id="clip1_1351_59964"> <rect fill="white" height="27" transform="translate(2 1.30966)" width="24"> </rect> </clippath> </defs> </svg> <span> C# </span> </a> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/indexes/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 30 41" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M10.0921 30.7949C10.0921 30.7949 8.57608 31.6793 11.166 31.9636C14.2929 32.311 15.9037 32.2794 19.3464 31.6161C19.3464 31.6161 20.2623 32.1846 21.5257 32.6901C13.7876 35.9748 4.02791 32.5005 10.0921 30.7949Z" fill="#0074BD"> </path> <path d="M9.14539 26.4678C9.14539 26.4678 7.43985 27.7312 10.0298 27.9838C13.3778 28.3312 15.9992 28.3628 20.579 27.4785C20.579 27.4785 21.2107 28.1101 22.1898 28.4576C12.8724 31.2054 2.44949 28.6787 9.14539 26.4678Z" fill="#0074BD"> </path> <path d="M17.1039 19.1398C18.9989 21.3191 16.5985 23.3089 16.5985 23.3089C16.5985 23.3089 21.431 20.8138 19.2201 17.6869C17.1355 14.7811 15.5563 13.3282 24.1788 8.33789C24.1473 8.33789 10.6607 11.6858 17.1039 19.1398Z" fill="#EA2D2E"> </path> <path d="M27.3377 33.9845C27.3377 33.9845 28.4431 34.9004 26.1059 35.6269C21.6525 36.985 7.53417 37.3957 3.61769 35.6901C2.19639 35.0899 4.84949 34.2372 5.67069 34.0477C6.52347 33.8582 7.02884 33.8898 7.02884 33.8898C5.44961 32.7843 -3.10981 36.0691 2.67016 36.9851C18.4308 39.5433 31.4121 35.8164 27.3377 33.9845Z" fill="#0074BD"> </path> <path d="M10.8194 21.983C10.8194 21.983 3.6497 23.6885 8.2926 24.3203C10.2509 24.5729 14.1357 24.5097 17.7995 24.2255C20.7685 23.9728 23.7375 23.4359 23.7375 23.4359C23.7375 23.4359 22.6951 23.8781 21.9372 24.415C14.6411 26.3416 0.585992 25.4257 4.62881 23.4675C8.00839 21.7935 10.8194 21.983 10.8194 21.983Z" fill="#0074BD"> </path> <path d="M23.6745 29.1846C31.0969 25.3313 27.6542 21.6359 25.2538 22.1413C24.6537 22.2676 24.401 22.3623 24.401 22.3623C24.401 22.3623 24.6221 22.0149 25.0327 21.8886C29.7703 20.2146 33.4025 26.7842 23.5166 29.4057C23.5482 29.3741 23.6429 29.2794 23.6745 29.1846Z" fill="#0074BD"> </path> <path d="M19.2206 0.25293C19.2206 0.25293 23.3266 4.35891 15.3357 10.6758C8.92404 15.7293 13.8828 18.6351 15.3357 21.9199C11.6087 18.5403 8.86088 15.5714 10.6928 12.792C13.3775 8.74919 20.863 6.79093 19.2206 0.25293Z" fill="#EA2D2E"> </path> <path d="M11.5455 39.6068C18.6521 40.049 29.5803 39.3541 29.833 35.9746C29.833 35.9746 29.3276 37.238 23.9583 38.2487C17.894 39.3858 10.4085 39.2594 5.95508 38.533C5.95508 38.5646 6.87103 39.3225 11.5455 39.6068Z" fill="#0074BD"> </path> </svg> <span> Java Sync </span> </a> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/drivers/node/current/fundamentals/indexes/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 30 30" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:R4dt5qcmqn9:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":R4dt5qcmqn9:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":R4dt5qcmqn9:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":R4dt5qcmqn9:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <span> Node.js </span> </a> <a class="leafygreen-ui-v22cck" href="https://www.mongodb.com/docs/languages/python/pymongo-driver/current/work-with-indexes/" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 111.6 147" width="24" xmlns="http://www.w3.org/2000/svg"> <lineargradient gradienttransform="matrix(.5625 0 0 -.568 -160.323 -146.09)" gradientunits="userSpaceOnUse" id=":R4ht5qcmqn9:aa" x1="280.848" x2="389.865" y1="-268.463" y2="-362.257"> <stop offset="0" stop-color="#5a9fd4"> </stop> <stop offset="1" stop-color="#306998"> </stop> </lineargradient> <path d="M55.3 3.2c-4.6 0-9 .4-12.8 1.1-11.3 2-13.4 6.2-13.4 13.9v10.2h26.8v3.4H19c-7.8 0-14.6 4.7-16.8 13.6C-.3 55.6-.4 62 2.2 72.7c1.9 7.9 6.5 13.6 14.2 13.6h9.2V74c0-8.8 7.7-16.7 16.7-16.7h26.8c7.5 0 13.4-6.1 13.4-13.6V18.2c0-7.3-6.1-12.7-13.4-13.9-4.4-.8-9.2-1.1-13.8-1.1zm-14.5 8.2c2.8 0 5 2.3 5 5.1s-2.3 5.1-5 5.1c-2.8 0-5-2.3-5-5.1s2.2-5.1 5-5.1z" fill="url(#:R4ht5qcmqn9:aa)"> </path> <lineargradient gradienttransform="matrix(.5625 0 0 -.568 -160.323 -146.09)" gradientunits="userSpaceOnUse" id=":R4ht5qcmqn9:bb" x1="432.011" x2="393.081" y1="-419.025" y2="-363.946"> <stop offset="0" stop-color="#ffd43b"> </stop> <stop offset="1" stop-color="#ffe873"> </stop> </lineargradient> <path d="M86 31.8v11.9c0 9.2-7.8 17-16.8 17H42.5c-7.3 0-13.4 6.3-13.4 13.6v25.5c0 7.3 6.3 11.5 13.4 13.6 8.5 2.5 16.6 2.9 26.8 0 6.8-2 13.4-5.9 13.4-13.6V89.7H55.9v-3.4h40.2c7.8 0 10.7-5.4 13.4-13.6 2.8-8.4 2.7-16.5 0-27.3-1.9-7.8-5.6-13.6-13.4-13.6H86zM71 96.5c2.8 0 5 2.3 5 5.1s-2.3 5.1-5 5.1c-2.8 0-5-2.3-5-5.1-.1-2.8 2.2-5.1 5-5.1z" fill="url(#:R4ht5qcmqn9:bb)"> </path> <radialgradient cx="-2274.721" cy="144.526" gradienttransform="matrix(0 -.2399 -1.0547 0 208.637 -414.922)" gradientunits="userSpaceOnUse" id=":R4ht5qcmqn9:cc" r="29.037"> <stop offset="0" stop-color="#b8b8b8" stop-opacity=".498"> </stop> <stop offset="1" stop-color="#7f7f7f" stop-opacity="0"> </stop> </radialgradient> <path d="M92.1 130.9c0 3.8-16.1 7-35.9 7s-35.9-3.1-35.9-7c0-3.8 16.1-7 35.9-7s35.9 3.1 35.9 7z" fill="url(#:R4ht5qcmqn9:cc)" opacity=".444"> </path> </svg> <span> PyMongo </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/languages/c/c-driver/current/libmongoc/guides/manage-collection-indexes/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_1351_59955)"> <g clip-path="url(#clip1_1351_59955)"> <path clip-rule="evenodd" d="M13.118 1.49532C13.5403 1.25103 14.0559 1.25103 14.4783 1.49532C16.5652 2.70389 22.8385 6.34889 24.9193 7.55748C25.3416 7.80172 25.6025 8.25176 25.6025 8.74672C25.6025 11.1703 25.6025 18.4539 25.6025 20.8774C25.6025 21.366 25.3416 21.8224 24.9193 22.0667C22.8385 23.2753 16.5652 26.9203 14.4783 28.1289C14.0559 28.3732 13.5403 28.3732 13.118 28.1289C11.0373 26.9139 4.76398 23.2689 2.68323 22.0603C2.26087 21.816 2 21.366 2 20.871C2 18.4474 2 11.1639 2 8.7403C2 8.25176 2.26087 7.7953 2.68323 7.55106C4.76398 6.34889 11.0373 2.70389 13.118 1.49532Z" fill="#004482" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M2.18634 21.4946C2.01863 21.2632 2 21.051 2 20.7553C2 18.351 2 11.1061 2 8.70176C2 8.21317 2.26087 7.76319 2.67702 7.51889C4.75776 6.31675 11.0062 2.69104 13.0807 1.4889C13.5031 1.24461 14.0683 1.25104 14.4907 1.49533C16.5652 2.69747 22.795 6.29104 24.8696 7.49319C25.0373 7.58963 25.1677 7.70535 25.2795 7.86606L2.18634 21.4946Z" fill="#659AD2" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M13.8011 5.8089C18.6024 5.8089 22.4968 9.83964 22.4968 14.8089C22.4968 19.7782 18.6024 23.8089 13.8011 23.8089C8.99986 23.8089 5.10547 19.7782 5.10547 14.8089C5.10547 9.83964 8.99986 5.8089 13.8011 5.8089ZM13.8011 10.3089C16.1987 10.3089 18.1489 12.3275 18.1489 14.8089C18.1489 17.2903 16.1987 19.3089 13.8011 19.3089C11.4036 19.3089 9.4533 17.2903 9.4533 14.8089C9.4533 12.3275 11.4036 10.3089 13.8011 10.3089Z" fill="white" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M25.2857 7.87247C25.6087 8.18102 25.6025 8.65034 25.6025 9.01673C25.6025 11.4596 25.5839 18.396 25.6087 20.8325C25.6087 21.0896 25.528 21.3532 25.4099 21.5589L13.5466 14.8089L25.2857 7.87247Z" fill="#00599C" fill-rule="evenodd"> </path> </g> </g> <defs> <clippath id="clip0_1351_59955"> <rect fill="white" height="28" transform="translate(0 0.809265)" width="28"> </rect> </clippath> <clippath id="clip1_1351_59955"> <rect fill="white" height="27" transform="translate(2 1.30887)" width="24"> </rect> </clippath> </defs> </svg> <span> C </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/languages/cpp/cpp-driver/current/tutorial/#create-indexes" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_1351_59959)"> <g clip-path="url(#clip1_1351_59959)"> <path d="M25.4013 21.5646C25.5872 21.2353 25.7034 20.8745 25.7034 20.5373V9.08012C25.7034 8.75078 25.5872 8.38217 25.4013 8.05283L13.8516 14.8127L25.4013 21.5646Z" fill="#00599C"> </path> <path d="M14.8738 28.0657L24.6729 22.3411C24.9517 22.1764 25.2151 21.8941 25.401 21.5647L13.8513 14.8127L2.30151 21.5647C2.48743 21.8941 2.74305 22.1764 3.02967 22.3411L12.8288 28.0657C13.3865 28.3951 14.316 28.3951 14.8738 28.0657Z" fill="#004482"> </path> <path d="M25.4011 8.06086C25.2152 7.73146 24.9596 7.44915 24.673 7.2845L14.8739 1.55983C14.3084 1.23046 13.3866 1.23046 12.8211 1.55983L3.02202 7.2845C2.46429 7.61385 1.99951 8.42158 1.99951 9.08033V20.5375C1.99951 20.8669 2.11571 21.2354 2.30162 21.5647L13.8514 14.8128L25.4011 8.06086Z" fill="#659AD2"> </path> <path d="M13.8512 22.8115C9.49778 22.8115 5.94995 19.2199 5.94995 14.8127C5.94995 10.4055 9.49778 6.81387 13.8512 6.81387C16.6631 6.81387 19.2813 8.34305 20.6912 10.8133L17.2751 12.813C16.5701 11.5818 15.261 10.8133 13.8512 10.8133C11.6745 10.8133 9.90055 12.6091 9.90055 14.8127C9.90055 17.0163 11.6745 18.8121 13.8512 18.8121C15.261 18.8121 16.5701 18.0436 17.2751 16.8124L20.6912 18.8121C19.2813 21.2745 16.6631 22.8115 13.8512 22.8115Z" fill="white"> </path> <path d="M21.7524 14.3657H20.8771V13.4796H19.994V14.3657H19.1187V15.2518H19.994V16.1458H20.8771V15.2518H21.7524V14.3657Z" fill="white"> </path> <path d="M25.0446 14.3657H24.1693V13.4796H23.2862V14.3657H22.4109V15.2518H23.2862V16.1458H24.1693V15.2518H25.0446V14.3657Z" fill="white"> </path> </g> </g> <defs> <clippath id="clip0_1351_59959"> <rect fill="white" height="28" transform="translate(0 0.809265)" width="28"> </rect> </clippath> <clippath id="clip1_1351_59959"> <rect fill="white" height="27" transform="translate(1.99951 1.30878)" width="24"> </rect> </clippath> </defs> </svg> <span> C++ </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/drivers/go/current/fundamentals/indexes/" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" id="Layer_1" style="fill:#00ACD7" version="1.1" viewbox="0 0 205.4 76.7" width="24" x="0" xmlns="http://www.w3.org/2000/svg" y="0"> <path class="st00" d="M15.5 23.2c-.4 0-.5-.2-.3-.5l2.1-2.7c.2-.3.7-.5 1.1-.5h35.7c.4 0 .5.3.3.6l-1.7 2.6c-.2.3-.7.6-1 .6l-36.2-.1zM.4 32.4c-.4 0-.5-.2-.3-.5l2.1-2.7c.2-.3.7-.5 1.1-.5h45.6c.4 0 .6.3.5.6l-.8 2.4c-.1.4-.5.6-.9.6l-47.3.1zM24.6 41.6c-.4 0-.5-.3-.3-.6l1.4-2.5c.2-.3.6-.6 1-.6h20c.4 0 .6.3.6.7l-.2 2.4c0 .4-.4.7-.7.7l-21.8-.1z"> </path> <g id="CXHf1q_3_"> <path class="st00" d="M128.4 21.4c-6.3 1.6-10.6 2.8-16.8 4.4-1.5.4-1.6.5-2.9-1-1.5-1.7-2.6-2.8-4.7-3.8-6.3-3.1-12.4-2.2-18.1 1.5-6.8 4.4-10.3 10.9-10.2 19 .1 8 5.6 14.6 13.5 15.7 6.8.9 12.5-1.5 17-6.6.9-1.1 1.7-2.3 2.7-3.7H89.6c-2.1 0-2.6-1.3-1.9-3 1.3-3.1 3.7-8.3 5.1-10.9.3-.6 1-1.6 2.5-1.6h36.4c-.2 2.7-.2 5.4-.6 8.1-1.1 7.2-3.8 13.8-8.2 19.6-7.2 9.5-16.6 15.4-28.5 17-9.8 1.3-18.9-.6-26.9-6.6-7.4-5.6-11.6-13-12.7-22.2-1.3-10.9 1.9-20.7 8.5-29.3C70.4 8.7 79.8 2.8 91.3.7c9.4-1.7 18.4-.6 26.5 4.9 5.3 3.5 9.1 8.3 11.6 14.1.6.9.2 1.4-1 1.7z"> </path> <path class="st00" d="M161.5 76.7c-9.1-.2-17.4-2.8-24.4-8.8-5.9-5.1-9.6-11.6-10.8-19.3-1.8-11.3 1.3-21.3 8.1-30.2 7.3-9.6 16.1-14.6 28-16.7 10.2-1.8 19.8-.8 28.5 5.1 7.9 5.4 12.8 12.7 14.1 22.3 1.7 13.5-2.2 24.5-11.5 33.9-6.6 6.7-14.7 10.9-24 12.8-2.7.5-5.4.6-8 .9zm23.8-40.4c-.1-1.3-.1-2.3-.3-3.3-1.8-9.9-10.9-15.5-20.4-13.3-9.3 2.1-15.3 8-17.5 17.4-1.8 7.8 2 15.7 9.2 18.9 5.5 2.4 11 2.1 16.3-.6 7.9-4.1 12.2-10.5 12.7-19.1z"> </path> </g> </svg> <span> Go </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/languages/java/reactive-streams-driver/current/tutorials/indexes/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 30 41" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M10.0921 30.7949C10.0921 30.7949 8.57608 31.6793 11.166 31.9636C14.2929 32.311 15.9037 32.2794 19.3464 31.6161C19.3464 31.6161 20.2623 32.1846 21.5257 32.6901C13.7876 35.9748 4.02791 32.5005 10.0921 30.7949Z" fill="#0074BD"> </path> <path d="M9.14539 26.4678C9.14539 26.4678 7.43985 27.7312 10.0298 27.9838C13.3778 28.3312 15.9992 28.3628 20.579 27.4785C20.579 27.4785 21.2107 28.1101 22.1898 28.4576C12.8724 31.2054 2.44949 28.6787 9.14539 26.4678Z" fill="#0074BD"> </path> <path d="M17.1039 19.1398C18.9989 21.3191 16.5985 23.3089 16.5985 23.3089C16.5985 23.3089 21.431 20.8138 19.2201 17.6869C17.1355 14.7811 15.5563 13.3282 24.1788 8.33789C24.1473 8.33789 10.6607 11.6858 17.1039 19.1398Z" fill="#EA2D2E"> </path> <path d="M27.3377 33.9845C27.3377 33.9845 28.4431 34.9004 26.1059 35.6269C21.6525 36.985 7.53417 37.3957 3.61769 35.6901C2.19639 35.0899 4.84949 34.2372 5.67069 34.0477C6.52347 33.8582 7.02884 33.8898 7.02884 33.8898C5.44961 32.7843 -3.10981 36.0691 2.67016 36.9851C18.4308 39.5433 31.4121 35.8164 27.3377 33.9845Z" fill="#0074BD"> </path> <path d="M10.8194 21.983C10.8194 21.983 3.6497 23.6885 8.2926 24.3203C10.2509 24.5729 14.1357 24.5097 17.7995 24.2255C20.7685 23.9728 23.7375 23.4359 23.7375 23.4359C23.7375 23.4359 22.6951 23.8781 21.9372 24.415C14.6411 26.3416 0.585992 25.4257 4.62881 23.4675C8.00839 21.7935 10.8194 21.983 10.8194 21.983Z" fill="#0074BD"> </path> <path d="M23.6745 29.1846C31.0969 25.3313 27.6542 21.6359 25.2538 22.1413C24.6537 22.2676 24.401 22.3623 24.401 22.3623C24.401 22.3623 24.6221 22.0149 25.0327 21.8886C29.7703 20.2146 33.4025 26.7842 23.5166 29.4057C23.5482 29.3741 23.6429 29.2794 23.6745 29.1846Z" fill="#0074BD"> </path> <path d="M19.2206 0.25293C19.2206 0.25293 23.3266 4.35891 15.3357 10.6758C8.92404 15.7293 13.8828 18.6351 15.3357 21.9199C11.6087 18.5403 8.86088 15.5714 10.6928 12.792C13.3775 8.74919 20.863 6.79093 19.2206 0.25293Z" fill="#EA2D2E"> </path> <path d="M11.5455 39.6068C18.6521 40.049 29.5803 39.3541 29.833 35.9746C29.833 35.9746 29.3276 37.238 23.9583 38.2487C17.894 39.3858 10.4085 39.2594 5.95508 38.533C5.95508 38.5646 6.87103 39.3225 11.5455 39.6068Z" fill="#0074BD"> </path> </svg> <span> Java RS </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/drivers/kotlin/coroutine/current/fundamentals/indexes/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M28 29H0V1H28L14 15L28 29Z" fill="url(#:R55t5qcmqn9:paint0_linear_211_40588)"> </path> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":R55t5qcmqn9:paint0_linear_211_40588" x1="28" x2="8.34465e-07" y1="0.999999" y2="29"> <stop offset="0.00343514" stop-color="#E44857"> </stop> <stop offset="0.4689" stop-color="#C711E1"> </stop> <stop offset="1" stop-color="#7F52FF"> </stop> </lineargradient> </defs> </svg> <span> Kotlin Coroutine </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/languages/kotlin/kotlin-sync-driver/current/work-with-indexes/" target="_self"> <svg class="leafygreen-ui-x3zji3" fill="none" height="24" viewbox="0 0 28 29" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M28 29H0V1H28L14 15L28 29Z" fill="url(#:R59t5qcmqn9:paint0_linear_211_40588)"> </path> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":R59t5qcmqn9:paint0_linear_211_40588" x1="28" x2="8.34465e-07" y1="0.999999" y2="29"> <stop offset="0.00343514" stop-color="#E44857"> </stop> <stop offset="0.4689" stop-color="#C711E1"> </stop> <stop offset="1" stop-color="#7F52FF"> </stop> </lineargradient> </defs> </svg> <span> Kotlin Sync </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/php-library/current/reference/method/MongoDBCollection-createIndexes/" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 700 301" width="24" x="0" xmlns="http://www.w3.org/2000/svg" y="0"> <defs> <clippath clippathunits="userSpaceOnUse" id="a"> <path d="M11.52 162C11.52 81.677 135.307 16.561 288 16.561S564.481 81.677 564.481 162c0 80.322-123.788 145.439-276.481 145.439-152.693 0-276.48-65.117-276.48-145.439"> </path> </clippath> <clippath clippathunits="userSpaceOnUse" id="c"> <path d="M0 324h576V0H0v324z"> </path> </clippath> <clippath clippathunits="userSpaceOnUse" id="d"> <path d="M0 324h576V0H0v324z"> </path> </clippath> <radialgradient cx="0" cy="0" fx="0" fy="0" gradienttransform="matrix(363.05789 0 0 -363.05789 177.52 256.307)" gradientunits="userSpaceOnUse" id="b" r="1" spreadmethod="pad"> <stop offset="0" stop-color="#aeb2d5"> </stop> <stop offset=".3" stop-color="#aeb2d5"> </stop> <stop offset=".75" stop-color="#484c89"> </stop> <stop offset="1" stop-color="#484c89"> </stop> </radialgradient> </defs> <g clip-path="url(#a)" transform="matrix(1.25 0 0 -1.25 -4.4 394.299)"> <path d="M11.52 162C11.52 81.677 135.307 16.561 288 16.561S564.481 81.677 564.481 162c0 80.322-123.788 145.439-276.481 145.439-152.693 0-276.48-65.117-276.48-145.439" fill="url(#b)"> </path> </g> <g clip-path="url(#c)" transform="matrix(1.25 0 0 -1.25 -4.4 394.299)"> <path d="M288 27.36c146.729 0 265.68 60.28 265.68 134.64 0 74.36-118.951 134.641-265.68 134.641S22.32 236.36 22.32 162.001C22.32 87.64 141.271 27.358 288 27.358" fill="#777bb3"> </path> </g> <g clip-path="url(#d)" transform="matrix(1.25 0 0 -1.25 -4.4 394.299)"> <path d="M161.734 145.307c12.065 0 21.072 2.225 26.771 6.61 5.638 4.342 9.532 11.863 11.573 22.354 1.903 9.806 1.178 16.653-2.154 20.348-3.407 3.774-10.773 5.688-21.893 5.688h-19.28l-10.69-55h15.673zm-63.063-67.75a2.998 2.998 0 00-2.944 3.572l28.328 145.75a3 3 0 002.945 2.428h61.054c19.188 0 33.47-5.21 42.447-15.487 9.025-10.331 11.812-24.772 8.283-42.921-1.436-7.394-3.906-14.261-7.34-20.41-3.44-6.154-7.985-11.85-13.512-16.93-6.616-6.191-14.104-10.681-22.236-13.323-8.003-2.607-18.28-3.93-30.548-3.93h-24.722l-7.06-36.321a3 3 0 00-2.944-2.428h-31.75z"> </path> <path d="M159.224 197.307h16.808c13.42 0 18.083-2.945 19.667-4.7 2.628-2.914 3.124-9.058 1.435-17.767-1.898-9.75-5.416-16.663-10.458-20.545-5.162-3.974-13.554-5.988-24.941-5.988H149.7l9.523 49zm28.83 35H127a6 6 0 01-5.89-4.855L92.784 81.702a6 6 0 015.889-7.144h31.75a6 6 0 015.89 4.854l6.588 33.895h22.249c12.582 0 23.174 1.372 31.479 4.077 8.54 2.775 16.399 7.48 23.354 13.984 5.752 5.292 10.49 11.232 14.08 17.657 3.59 6.427 6.17 13.594 7.668 21.302 3.715 19.104.697 34.402-8.97 45.466-9.571 10.958-24.613 16.514-44.705 16.514m-45.633-90h19.313c12.8 0 22.336 2.411 28.6 7.234 6.267 4.824 10.493 12.875 12.689 24.157 2.1 10.832 1.144 18.476-2.871 22.93-4.02 4.452-12.06 6.68-24.121 6.68h-21.754l-11.856-61m45.633 84c18.367 0 31.766-4.82 40.188-14.462 8.42-9.64 10.957-23.098 7.597-40.375-1.383-7.117-3.722-13.624-7.015-19.519-3.297-5.899-7.602-11.293-12.922-16.184-6.34-5.933-13.383-10.16-21.133-12.679-7.75-2.525-17.621-3.782-29.621-3.782h-27.196l-7.531-38.75h-31.75L127 226.307h61.055" fill="#fff"> </path> <path d="M311.583 116.307c-.896 0-1.745.4-2.314 1.092a2.994 2.994 0 00-.631 2.48l12.531 64.489c1.192 6.133.898 10.535-.827 12.395-1.056 1.137-4.228 3.044-13.607 3.044h-22.702l-15.755-81.072a3 3 0 00-2.945-2.428h-31.5a2.998 2.998 0 00-2.945 3.572l28.328 145.75a3 3 0 002.945 2.428h31.5a3 3 0 002.945-3.572l-6.836-35.178h24.422c18.605 0 31.221-3.28 38.569-10.028 7.49-6.884 9.827-17.891 6.947-32.72l-13.18-67.824a3 3 0 00-2.945-2.428h-32z"> </path> <path d="M293.661 271.057h-31.5a6 6 0 01-5.89-4.855l-28.328-145.75a5.998 5.998 0 015.89-7.145h31.5a6 6 0 015.89 4.855l15.283 78.645h20.23c9.362 0 11.327-2 11.406-2.086.568-.61 1.315-3.44.082-9.78l-12.53-64.49a5.998 5.998 0 015.89-7.144h32a6 6 0 015.89 4.855l13.178 67.825c3.093 15.921.447 27.864-7.86 35.5-7.929 7.281-21.209 10.82-40.6 10.82h-20.784l6.143 31.605a6.001 6.001 0 01-5.89 7.145m0-6l-7.53-38.75h28.061c17.657 0 29.836-3.082 36.54-9.238 6.702-6.16 8.71-16.14 6.031-29.938l-13.18-67.824h-32l12.531 64.488c1.426 7.336.902 12.34-1.574 15.008-2.477 2.668-7.746 4.004-15.805 4.004H281.56l-16.226-83.5h-31.5l28.328 145.75h31.5" fill="#fff"> </path> <path d="M409.55 145.307c12.065 0 21.072 2.225 26.77 6.61 5.639 4.34 9.533 11.862 11.575 22.354 1.903 9.806 1.178 16.653-2.155 20.348-3.407 3.774-10.773 5.688-21.893 5.688h-19.281l-10.69-55h15.674zm-63.062-67.75a2.999 2.999 0 00-2.945 3.572l28.328 145.75a3.002 3.002 0 002.946 2.428h61.053c19.189 0 33.47-5.21 42.448-15.487 9.025-10.33 11.81-24.771 8.283-42.921-1.438-7.394-3.907-14.261-7.342-20.41-3.44-6.154-7.984-11.85-13.511-16.93-6.616-6.191-14.104-10.681-22.236-13.323-8.003-2.607-18.281-3.93-30.548-3.93H388.24l-7.057-36.321a3.001 3.001 0 00-2.946-2.428h-31.75z"> </path> <path d="M407.04 197.307h16.807c13.421 0 18.083-2.945 19.667-4.7 2.63-2.914 3.125-9.058 1.435-17.766-1.898-9.75-5.417-16.664-10.458-20.546-5.162-3.974-13.554-5.988-24.94-5.988h-12.034l9.522 49zm28.83 35h-61.054a6 6 0 01-5.889-4.855L340.6 81.702a6 6 0 015.889-7.144h31.75a6 6 0 015.89 4.854l6.587 33.895h22.25c12.581 0 23.173 1.372 31.478 4.077 8.541 2.775 16.401 7.481 23.356 13.986 5.752 5.291 10.488 11.23 14.078 17.655 3.591 6.427 6.171 13.594 7.668 21.302 3.715 19.105.697 34.403-8.969 45.467-9.572 10.957-24.613 16.513-44.706 16.513m-45.632-90h19.312c12.801 0 22.336 2.411 28.601 7.234 6.267 4.824 10.492 12.875 12.688 24.157 2.102 10.832 1.145 18.476-2.87 22.93-4.02 4.452-12.06 6.68-24.122 6.68h-21.754l-11.855-61m45.632 84c18.367 0 31.766-4.82 40.188-14.462 8.422-9.64 10.957-23.098 7.597-40.375-1.383-7.117-3.722-13.624-7.015-19.519-3.297-5.899-7.602-11.293-12.922-16.184-6.34-5.933-13.383-10.16-21.133-12.679-7.75-2.525-17.62-3.782-29.62-3.782h-27.197l-7.53-38.75h-31.75l28.328 145.75h61.054" fill="#fff"> </path> </g> </svg> <span> PHP </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://motor.readthedocs.io/en/stable/api-tornado/motor_collection.html#motor.motor_tornado.MotorCollection.create_indexes" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 111.6 147" width="24" xmlns="http://www.w3.org/2000/svg"> <lineargradient gradienttransform="matrix(.5625 0 0 -.568 -160.323 -146.09)" gradientunits="userSpaceOnUse" id=":R5ht5qcmqn9:aa" x1="280.848" x2="389.865" y1="-268.463" y2="-362.257"> <stop offset="0" stop-color="#5a9fd4"> </stop> <stop offset="1" stop-color="#306998"> </stop> </lineargradient> <path d="M55.3 3.2c-4.6 0-9 .4-12.8 1.1-11.3 2-13.4 6.2-13.4 13.9v10.2h26.8v3.4H19c-7.8 0-14.6 4.7-16.8 13.6C-.3 55.6-.4 62 2.2 72.7c1.9 7.9 6.5 13.6 14.2 13.6h9.2V74c0-8.8 7.7-16.7 16.7-16.7h26.8c7.5 0 13.4-6.1 13.4-13.6V18.2c0-7.3-6.1-12.7-13.4-13.9-4.4-.8-9.2-1.1-13.8-1.1zm-14.5 8.2c2.8 0 5 2.3 5 5.1s-2.3 5.1-5 5.1c-2.8 0-5-2.3-5-5.1s2.2-5.1 5-5.1z" fill="url(#:R5ht5qcmqn9:aa)"> </path> <lineargradient gradienttransform="matrix(.5625 0 0 -.568 -160.323 -146.09)" gradientunits="userSpaceOnUse" id=":R5ht5qcmqn9:bb" x1="432.011" x2="393.081" y1="-419.025" y2="-363.946"> <stop offset="0" stop-color="#ffd43b"> </stop> <stop offset="1" stop-color="#ffe873"> </stop> </lineargradient> <path d="M86 31.8v11.9c0 9.2-7.8 17-16.8 17H42.5c-7.3 0-13.4 6.3-13.4 13.6v25.5c0 7.3 6.3 11.5 13.4 13.6 8.5 2.5 16.6 2.9 26.8 0 6.8-2 13.4-5.9 13.4-13.6V89.7H55.9v-3.4h40.2c7.8 0 10.7-5.4 13.4-13.6 2.8-8.4 2.7-16.5 0-27.3-1.9-7.8-5.6-13.6-13.4-13.6H86zM71 96.5c2.8 0 5 2.3 5 5.1s-2.3 5.1-5 5.1c-2.8 0-5-2.3-5-5.1-.1-2.8 2.2-5.1 5-5.1z" fill="url(#:R5ht5qcmqn9:bb)"> </path> <radialgradient cx="-2274.721" cy="144.526" gradienttransform="matrix(0 -.2399 -1.0547 0 208.637 -414.922)" gradientunits="userSpaceOnUse" id=":R5ht5qcmqn9:cc" r="29.037"> <stop offset="0" stop-color="#b8b8b8" stop-opacity=".498"> </stop> <stop offset="1" stop-color="#7f7f7f" stop-opacity="0"> </stop> </radialgradient> <path d="M92.1 130.9c0 3.8-16.1 7-35.9 7s-35.9-3.1-35.9-7c0-3.8 16.1-7 35.9-7s35.9 3.1 35.9 7z" fill="url(#:R5ht5qcmqn9:cc)" opacity=".444"> </path> </svg> <span> Motor </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/mongoid/current/reference/indexes/" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" preserveaspectratio="xMidYMid" viewbox="0 0 300 240" width="24" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id=":R5lt5qcmqn9:a" x1="84.75%" x2="58.254%" y1="111.399%" y2="64.584%"> <stop offset="0%" stop-color="#FB7655"> </stop> <stop offset="0%" stop-color="#FB7655"> </stop> <stop offset="41%" stop-color="#E42B1E"> </stop> <stop offset="99%" stop-color="#900"> </stop> <stop offset="100%" stop-color="#900"> </stop> </lineargradient> <lineargradient id=":R5lt5qcmqn9:b" x1="116.651%" x2="1.746%" y1="60.89%" y2="19.288%"> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="99%" stop-color="#911209"> </stop> <stop offset="100%" stop-color="#911209"> </stop> </lineargradient> <lineargradient id=":R5lt5qcmqn9:c" x1="75.774%" x2="38.978%" y1="219.327%" y2="7.829%"> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="0%" stop-color="#871101"> </stop> <stop offset="99%" stop-color="#911209"> </stop> <stop offset="100%" stop-color="#911209"> </stop> </lineargradient> <lineargradient id=":R5lt5qcmqn9:d" x1="50.012%" x2="66.483%" y1="7.234%" y2="79.135%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="23%" stop-color="#E57252"> </stop> <stop offset="46%" stop-color="#DE3B20"> </stop> <stop offset="99%" stop-color="#A60003"> </stop> <stop offset="100%" stop-color="#A60003"> </stop> </lineargradient> <lineargradient id=":R5lt5qcmqn9:e" x1="46.174%" x2="49.932%" y1="16.348%" y2="83.047%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="23%" stop-color="#E4714E"> </stop> <stop offset="56%" stop-color="#BE1A0D"> </stop> <stop offset="99%" stop-color="#A80D00"> </stop> <stop offset="100%" stop-color="#A80D00"> </stop> </lineargradient> <lineargradient id=":R5lt5qcmqn9:f" x1="36.965%" x2="49.528%" y1="15.594%" y2="92.478%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="18%" stop-color="#E46342"> </stop> <stop offset="40%" stop-color="#C82410"> </stop> <stop offset="99%" stop-color="#A80D00"> </stop> <stop offset="100%" stop-color="#A80D00"> </stop> </lineargradient> <lineargradient id=":R5lt5qcmqn9:g" x1="13.609%" x2="85.764%" y1="58.346%" y2="-46.717%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="54%" stop-color="#C81F11"> </stop> <stop offset="99%" stop-color="#BF0905"> </stop> <stop offset="100%" stop-color="#BF0905"> </stop> </lineargradient> <lineargradient id=":R5lt5qcmqn9:h" x1="27.624%" x2="50.745%" y1="21.135%" y2="79.056%"> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="0%" stop-color="#FFF"> </stop> <stop offset="31%" stop-color="#DE4024"> </stop> <stop offset="99%" stop-color="#BF190B"> </stop> <stop offset="100%" stop-color="#BF190B"> </stop> </lineargradient> <lineargradient id=":R5lt5qcmqn9:i" x1="-20.667%" x2="104.242%" y1="122.282%" y2="-6.342%"> <stop offset="0%" stop-color="#BD0012"> </stop> <stop offset="0%" stop-color="#BD0012"> </stop> <stop offset="7%" stop-color="#FFF"> </stop> <stop offset="17%" stop-color="#FFF"> </stop> <stop offset="27%" stop-color="#C82F1C"> </stop> <stop offset="33%" stop-color="#820C01"> </stop> <stop offset="46%" stop-color="#A31601"> </stop> <stop offset="72%" stop-color="#B31301"> </stop> <stop offset="99%" stop-color="#E82609"> </stop> <stop offset="100%" stop-color="#E82609"> </stop> </lineargradient> <lineargradient id=":R5lt5qcmqn9:j" x1="58.792%" x2="11.964%" y1="65.205%" y2="50.128%"> <stop offset="0%" stop-color="#8C0C01"> </stop> <stop offset="0%" stop-color="#8C0C01"> </stop> <stop offset="54%" stop-color="#990C00"> </stop> <stop offset="99%" stop-color="#A80D0E"> </stop> <stop offset="100%" stop-color="#A80D0E"> </stop> </lineargradient> <lineargradient id=":R5lt5qcmqn9:k" x1="79.319%" x2="23.088%" y1="62.754%" y2="17.888%"> <stop offset="0%" stop-color="#7E110B"> </stop> <stop offset="0%" stop-color="#7E110B"> </stop> <stop offset="99%" stop-color="#9E0C00"> </stop> <stop offset="100%" stop-color="#9E0C00"> </stop> </lineargradient> <lineargradient id=":R5lt5qcmqn9:l" x1="92.88%" x2="59.841%" y1="74.122%" y2="39.704%"> <stop offset="0%" stop-color="#79130D"> </stop> <stop offset="0%" stop-color="#79130D"> </stop> <stop offset="99%" stop-color="#9E120B"> </stop> <stop offset="100%" stop-color="#9E120B"> </stop> </lineargradient> <lineargradient id=":R5lt5qcmqn9:o" x1="56.57%" x2="3.105%" y1="101.717%" y2="11.993%"> <stop offset="0%" stop-color="#8B2114"> </stop> <stop offset="0%" stop-color="#8B2114"> </stop> <stop offset="43%" stop-color="#9E100A"> </stop> <stop offset="99%" stop-color="#B3100C"> </stop> <stop offset="100%" stop-color="#B3100C"> </stop> </lineargradient> <lineargradient id=":R5lt5qcmqn9:p" x1="30.87%" x2="92.471%" y1="35.599%" y2="100.694%"> <stop offset="0%" stop-color="#B31000"> </stop> <stop offset="0%" stop-color="#B31000"> </stop> <stop offset="44%" stop-color="#910F08"> </stop> <stop offset="99%" stop-color="#791C12"> </stop> <stop offset="100%" stop-color="#791C12"> </stop> </lineargradient> <radialgradient cx="32.001%" cy="40.21%" fx="32.001%" fy="40.21%" id=":R5lt5qcmqn9:m" r="69.573%"> <stop offset="0%" stop-color="#A80D00"> </stop> <stop offset="0%" stop-color="#A80D00"> </stop> <stop offset="99%" stop-color="#7E0E08"> </stop> <stop offset="100%" stop-color="#7E0E08"> </stop> </radialgradient> <radialgradient cx="13.549%" cy="40.86%" fx="13.549%" fy="40.86%" id=":R5lt5qcmqn9:n" r="88.386%"> <stop offset="0%" stop-color="#A30C00"> </stop> <stop offset="0%" stop-color="#A30C00"> </stop> <stop offset="99%" stop-color="#800E08"> </stop> <stop offset="100%" stop-color="#800E08"> </stop> </radialgradient> </defs> <path d="M197.467 167.764l-145.52 86.41 188.422-12.787L254.88 51.393l-57.414 116.37z" fill="url(#:R5lt5qcmqn9:a)"> </path> <path d="M240.677 241.257L224.482 129.48l-44.113 58.25 60.308 53.528z" fill="url(#:R5lt5qcmqn9:b)"> </path> <path d="M240.896 241.257l-118.646-9.313-69.674 21.986 188.32-12.673z" fill="url(#:R5lt5qcmqn9:c)"> </path> <path d="M52.744 253.955l29.64-97.1L17.16 170.8l35.583 83.154z" fill="url(#:R5lt5qcmqn9:d)"> </path> <path d="M180.358 188.05L153.085 81.226l-78.047 73.16 105.32 33.666z" fill="url(#:R5lt5qcmqn9:e)"> </path> <path d="M248.693 82.73l-73.777-60.256-20.544 66.418 94.321-6.162z" fill="url(#:R5lt5qcmqn9:f)"> </path> <path d="M214.191.99L170.8 24.97 143.424.669l70.767.322z" fill="url(#:R5lt5qcmqn9:g)"> </path> <path d="M0 203.372l18.177-33.151-14.704-39.494L0 203.372z" fill="url(#:R5lt5qcmqn9:h)"> </path> <path d="M2.496 129.48l14.794 41.963 64.283-14.422 73.39-68.207 20.712-65.787L143.063 0 87.618 20.75c-17.469 16.248-51.366 48.396-52.588 49-1.21.618-22.384 40.639-32.534 59.73z" fill="#FFF"> </path> <path d="M54.442 54.094c37.86-37.538 86.667-59.716 105.397-40.818 18.72 18.898-1.132 64.823-38.992 102.349-37.86 37.525-86.062 60.925-104.78 42.027-18.73-18.885.515-66.032 38.375-103.558z" fill="url(#:R5lt5qcmqn9:i)"> </path> <path d="M52.744 253.916l29.408-97.409 97.665 31.376c-35.312 33.113-74.587 61.106-127.073 66.033z" fill="url(#:R5lt5qcmqn9:j)"> </path> <path d="M155.092 88.622l25.073 99.313c29.498-31.016 55.972-64.36 68.938-105.603l-94.01 6.29z" fill="url(#:R5lt5qcmqn9:k)"> </path> <path d="M248.847 82.833c10.035-30.282 12.35-73.725-34.966-81.791l-38.825 21.445 73.791 60.346z" fill="url(#:R5lt5qcmqn9:l)"> </path> <path d="M0 202.935c1.39 49.979 37.448 50.724 52.808 51.162l-35.48-82.86L0 202.935z" fill="#9E1209"> </path> <path d="M155.232 88.777c22.667 13.932 68.35 41.912 69.276 42.426 1.44.81 19.695-30.784 23.838-48.64l-93.114 6.214z" fill="url(#:R5lt5qcmqn9:m)"> </path> <path d="M82.113 156.507l39.313 75.848c23.246-12.607 41.45-27.967 58.121-44.42l-97.434-31.428z" fill="url(#:R5lt5qcmqn9:n)"> </path> <path d="M17.174 171.34l-5.57 66.328c10.51 14.357 24.97 15.605 40.136 14.486-10.973-27.311-32.894-81.92-34.566-80.814z" fill="url(#:R5lt5qcmqn9:o)"> </path> <path d="M174.826 22.654l78.1 10.96c-4.169-17.662-16.969-29.06-38.787-32.623l-39.313 21.663z" fill="url(#:R5lt5qcmqn9:p)"> </path> </svg> <span> Mongoid </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/drivers/rust/current/fundamentals/indexes/" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 30 30" width="24" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_5454_14623)"> <path d="M15.2561 3.08398C8.56014 3.08398 3.11035 8.53634 3.11035 15.2297C3.11035 21.9231 8.56271 27.3755 15.2561 27.3755C21.9495 27.3755 27.4019 21.9231 27.4019 15.2297C27.4019 8.53634 21.9495 3.08398 15.2561 3.08398ZM15.2381 4.16315C15.4458 4.16853 15.6432 4.25509 15.7881 4.40437C15.9331 4.55365 16.0142 4.75384 16.0141 4.96225C16.0141 5.17418 15.9299 5.37744 15.7801 5.5273C15.6302 5.67715 15.4269 5.76134 15.215 5.76134C15.0031 5.76134 14.7998 5.67715 14.65 5.5273C14.5001 5.37744 14.4159 5.17418 14.4159 4.96225C14.4159 4.85533 14.4373 4.7495 14.4789 4.65101C14.5205 4.55252 14.5814 4.46338 14.6581 4.38887C14.7347 4.31435 14.8256 4.25598 14.9252 4.21721C15.0249 4.17844 15.1313 4.16006 15.2381 4.16315ZM17.0676 5.47871C18.4704 5.74146 19.7992 6.30644 20.9617 7.13439C22.1242 7.96235 23.0926 9.03345 23.7995 10.2733L22.8565 12.4008C22.6947 12.7682 22.8617 13.1999 23.2265 13.3643L25.0406 14.1686C25.0968 14.7356 25.1037 15.3065 25.0611 15.8747H24.0513C23.9511 15.8747 23.91 15.9415 23.91 16.0391V16.5016C23.91 17.5911 23.2959 17.83 22.7563 17.8891C22.2424 17.9482 21.6746 17.6733 21.6026 17.3598C21.2994 15.6563 20.7958 15.294 19.9993 14.6645C20.9885 14.0375 22.0163 13.11 22.0163 11.8715C22.0163 10.5328 21.099 9.69002 20.4747 9.27634C19.5959 8.69822 18.6247 8.5826 18.3626 8.5826H7.93063C9.37312 6.97114 11.3066 5.88021 13.4318 5.47871L14.6626 6.76857C14.9401 7.05891 15.4 7.07176 15.6903 6.79169L17.0676 5.47871ZM5.71063 11.3936C5.91853 11.3996 6.11589 11.4864 6.26079 11.6356C6.40568 11.7849 6.48669 11.9847 6.4866 12.1927C6.4866 12.4046 6.40241 12.6079 6.25255 12.7577C6.10269 12.9076 5.89944 12.9918 5.6875 12.9918C5.47557 12.9918 5.27232 12.9076 5.12246 12.7577C4.9726 12.6079 4.88841 12.4046 4.88841 12.1927C4.88836 12.0858 4.90977 11.9799 4.95137 11.8814C4.99297 11.7829 5.0539 11.6938 5.13057 11.6193C5.20724 11.5448 5.29809 11.4864 5.39772 11.4476C5.49736 11.4089 5.60376 11.3905 5.71063 11.3936ZM24.7631 11.4295C24.971 11.4356 25.1683 11.5224 25.3132 11.6716C25.4581 11.8208 25.5391 12.0206 25.539 12.2286C25.539 12.4406 25.4548 12.6438 25.305 12.7937C25.1551 12.9435 24.9519 13.0277 24.7399 13.0277C24.528 13.0277 24.3247 12.9435 24.1749 12.7937C24.025 12.6438 23.9408 12.4406 23.9408 12.2286C23.9408 12.1217 23.9622 12.0159 24.0038 11.9174C24.0454 11.8189 24.1063 11.7298 24.183 11.6553C24.2597 11.5807 24.3505 11.5224 24.4502 11.4836C24.5498 11.4448 24.6562 11.4264 24.7631 11.4295ZM7.21632 11.558H8.60896V17.8377H5.79799C5.45083 16.6186 5.34264 15.3439 5.47938 14.0838L7.20091 13.3181C7.56834 13.1536 7.73535 12.7245 7.57091 12.3571L7.21632 11.558ZM13.0284 11.6248H16.3456C16.5177 11.6248 17.5558 11.8227 17.5558 12.6012C17.5558 13.2461 16.7592 13.4774 16.104 13.4774H13.0258L13.0284 11.6248ZM13.0284 16.1368H15.5696C15.8008 16.1368 16.8106 16.2036 17.1318 17.4934C17.232 17.8891 17.4556 19.179 17.6072 19.5927C17.7588 20.0552 18.3729 20.9802 19.0281 20.9802H23.1751C22.8972 21.3524 22.5933 21.7044 22.2656 22.0336L20.5774 21.6713C20.1843 21.5866 19.7963 21.8384 19.7115 22.2315L19.3107 24.102C18.0217 24.6859 16.622 24.9848 15.2069 24.9781C13.7919 24.9714 12.395 24.6595 11.1116 24.0635L10.7108 22.1929C10.626 21.7998 10.2406 21.548 9.84743 21.6328L8.19528 21.9874C7.88869 21.6711 7.6037 21.3346 7.34223 20.9802H15.3769C15.4668 20.9802 15.5285 20.9647 15.5285 20.88V18.0381C15.5285 17.9559 15.4668 17.9379 15.3769 17.9379H13.0258L13.0284 16.1368ZM9.3207 22.6452C9.5286 22.6512 9.72596 22.738 9.87085 22.8872C10.0157 23.0364 10.0968 23.2363 10.0967 23.4443C10.0967 23.6562 10.0125 23.8594 9.86262 24.0093C9.71276 24.1592 9.50951 24.2434 9.29757 24.2434C9.08564 24.2434 8.88239 24.1592 8.73253 24.0093C8.58267 23.8594 8.49848 23.6562 8.49848 23.4443C8.49843 23.3373 8.51984 23.2315 8.56144 23.133C8.60303 23.0345 8.66397 22.9454 8.74064 22.8709C8.81731 22.7964 8.90815 22.738 9.00779 22.6992C9.10743 22.6605 9.21383 22.6421 9.3207 22.6452ZM21.153 22.6811C21.3609 22.6872 21.5583 22.774 21.7031 22.9232C21.848 23.0724 21.929 23.2722 21.929 23.4802C21.929 23.6922 21.8448 23.8954 21.6949 24.0453C21.5451 24.1951 21.3418 24.2793 21.1299 24.2793C20.9179 24.2793 20.7147 24.1951 20.5648 24.0453C20.415 23.8954 20.3308 23.6922 20.3308 23.4802C20.3307 23.3733 20.3521 23.2675 20.3937 23.169C20.4353 23.0705 20.4963 22.9814 20.5729 22.9068C20.6496 22.8323 20.7404 22.774 20.8401 22.7352C20.9397 22.6964 21.0461 22.678 21.153 22.6811Z" fill="black"> </path> <path clip-rule="evenodd" d="M26.7232 15.2304C26.7232 18.2717 25.515 21.1885 23.3645 23.3391C21.2139 25.4896 18.2971 26.6978 15.2558 26.6978C12.2144 26.6978 9.29761 25.4896 7.14705 23.3391C4.99649 21.1885 3.78832 18.2717 3.78832 15.2304C3.78832 12.189 4.99649 9.27222 7.14705 7.12166C9.29761 4.9711 12.2144 3.76293 15.2558 3.76293C18.2971 3.76293 21.2139 4.9711 23.3645 7.12166C25.515 9.27222 26.7232 12.189 26.7232 15.2304ZM26.5073 14.1229L28.2957 15.2304L26.5073 16.3378L28.0439 17.7741L26.0757 18.5115L27.3039 20.2202L25.2252 20.5594L26.0988 22.4762L23.9944 22.4017L24.4775 24.4521L22.4271 23.969L22.5016 26.0734L20.5848 25.1998L20.2456 27.2785L18.5369 26.0503L17.7995 28.0185L16.3632 26.482L15.2558 28.2703L14.1483 26.482L12.712 28.0185L11.9746 26.0503L10.2659 27.2785L9.92672 25.1998L8.00992 26.0734L8.08443 23.969L6.03401 24.4521L6.51707 22.4017L4.4127 22.4762L5.28631 20.5594L3.20763 20.2202L4.43582 18.5115L2.46763 17.7741L4.00415 16.3378L2.21582 15.2304L4.00415 14.1229L2.46763 12.6866L4.43582 11.9492L3.20763 10.2405L5.28631 9.90133L4.4127 7.98453L6.51707 8.05904L6.03401 6.00862L8.08443 6.49168L8.00992 4.3873L9.92672 5.26092L10.2659 3.18223L11.9746 4.41043L12.712 2.44224L14.1483 3.97876L15.2558 2.19043L16.3632 3.97876L17.7995 2.44224L18.5369 4.41043L20.2456 3.18223L20.5848 5.26092L22.5016 4.3873L22.4271 6.49168L24.4775 6.00862L23.9944 8.05904L26.0988 7.98453L25.2252 9.90133L27.3039 10.2405L26.0757 11.9492L28.0439 12.6866L26.5073 14.1229Z" fill="black" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"> </path> </g> <defs> <clippath id="clip0_5454_14623"> <rect fill="black" height="30" width="30"> </rect> </clippath> </defs> </svg> <span> Rust </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://www.mongodb.com/docs/languages/scala/scala-driver/current/tutorials/indexes/" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="0 0 70 70" width="24" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id=":R5tt5qcmqn9:aaa" x1=".006%" x2="96.837%" y1="49.998%" y2="49.998%"> <stop offset="0%" stop-color="#CD413F"> </stop> <stop offset="75.091%" stop-color="#CD4543"> </stop> <stop offset="100%" stop-color="#D04543"> </stop> </lineargradient> </defs> <g fill="none" fill-rule="nonzero"> <path d="M13 39v5c0 .843 17.73 2.255 29.28 5 5.582-1.327 9.72-2.966 9.72-5v-5c0-2.034-4.138-3.673-9.72-5C30.73 36.745 13 38.157 13 39M13 20v5c0 .843 17.73 2.255 29.28 5 5.582-1.327 9.72-2.966 9.72-5v-5c0-2.034-4.138-3.673-9.72-5C30.73 17.745 13 19.157 13 20" fill="#731818"> </path> <g fill="url(#:R5tt5qcmqn9:aaa)" transform="translate(13)"> <path d="M0 29.53v14.766c0-1.232 39-3.692 39-9.844V19.686c0 6.152-39 8.612-39 9.844M0 9.843V24.61c0-1.231 39-3.691 39-9.843V0C39 6.152 0 8.612 0 9.843M0 49.216v14.766c0-1.231 39-3.691 39-9.843V39.373c0 6.151-39 8.612-39 9.843"> </path> </g> </g> </svg> <span> Scala </span> </a> <a class="leafygreen-ui-18cpm0b" href="https://mongodb.github.io/mongo-swift-driver/docs/current/MongoSwift/Structs/MongoCollection.html#/s:10MongoSwift0A10CollectionV13createIndexes_7options7sessionSaySSGSayAA10IndexModelVG_AA06CreateH7OptionsVSgAA13ClientSessionCSgtYaKF" target="_self"> <svg class="leafygreen-ui-x3zji3" height="24" viewbox="-252 343.9 106.1 106.1" width="24" xmlns="http://www.w3.org/2000/svg"> <path d="M-145.9 373.3v-3.2c-.1-2.3-.2-4.7-.6-7-.4-2.3-1.1-4.5-2.2-6.6-1.1-2.1-2.4-4-4.1-5.6-1.7-1.7-3.6-3-5.6-4.1-2.1-1.1-4.3-1.8-6.6-2.2-2.3-.4-4.6-.6-7-.6h-53.7c-.6 0-1.2 0-1.7.1-1.7.1-3.5.2-5.2.5-1.7.3-3.4.8-5 1.4-.5.2-1.1.5-1.6.7-1.6.8-3 1.8-4.4 2.9-.4.4-.9.8-1.3 1.2-1.7 1.7-3 3.6-4.1 5.6-1.1 2.1-1.8 4.3-2.2 6.6-.4 2.3-.5 4.6-.6 7v53.7c.1 2.3.2 4.7.6 7 .4 2.3 1.1 4.5 2.2 6.6 1.1 2.1 2.4 4 4.1 5.6 1.7 1.7 3.6 3 5.6 4.1 2.1 1.1 4.3 1.8 6.6 2.2 2.3.4 4.6.6 7 .6h53.7c2.3-.1 4.7-.2 7-.6 2.3-.4 4.5-1.1 6.6-2.2 2.1-1.1 4-2.4 5.6-4.1 1.7-1.7 3-3.6 4.1-5.6 1.1-2.1 1.8-4.3 2.2-6.6.4-2.3.6-4.6.6-7v-3.2V377v-3.7z" fill="#F05138"> </path> <path d="M-168 409.4l.3-1.2c4.4-17.5-6.3-38.3-24.5-49.2 8 10.8 11.5 23.9 8.4 35.3-.3 1-.6 2-1 3-.4-.3-.9-.6-1.6-.9 0 0-18.1-11.2-37.7-30.9-.5-.5 10.5 15.7 22.9 28.8-5.9-3.3-22.2-15.2-32.6-24.6 1.3 2.1 2.8 4.2 4.4 6.1 8.6 11 19.9 24.5 33.4 34.9-9.5 5.8-22.9 6.3-36.2 0-3.3-1.5-6.4-3.4-9.3-5.5 5.6 9 14.3 16.8 24.9 21.4 12.6 5.4 25.2 5.1 34.5.1 0 0 .1 0 .1-.1.4-.2.8-.5 1.2-.7 4.5-2.3 13.3-4.6 18.1 4.6 1.4 2.1 3.9-9.9-5.3-21.1z" fill="#FFF"> </path> </svg> <span> Swift </span> </a> </div> <button class="leafygreen-ui-ki2t97"> Show all <svg aria-label="Chevron Down Icon" class="" fill="none" height="16" role="img" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M1.636 5.364a1 1 0 0 0 0 1.414l4.95 4.95.707.707a1 1 0 0 0 1.414 0l.707-.707 4.95-4.95a1 1 0 0 0 0-1.414l-.707-.707a1 1 0 0 0-1.414 0L8 8.899 3.757 4.657a1 1 0 0 0-1.414 0l-.707.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </button> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes( [ keyPatterns ], options, commitQuorum ) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.collection.createIndexes" 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-method-db.collection.createIndexes"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Creates one or more indexes on a collection. </p> <p class="leafygreen-ui-1kp3ins"> To minimize the impact of building an index on replica sets and sharded clusters, use a rolling index build procedure as described on <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/build-indexes-on-replica-sets/#std-label-index-building-replica-sets"> Rolling Index Builds on Replica Sets <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.createIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </span> </a> takes the following parameters: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> keyPatterns </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-key_patterns"> </span> <p class="leafygreen-ui-1kp3ins"> An array containing index specification documents. Each document contains field and value pairs where the field is the index key and the value describes the type of index for that field. For an ascending index on a field, specify a value of <code class="leafygreen-ui-1l06pbn"> 1 </code> ; for descending index, specify a value of <code class="leafygreen-ui-1l06pbn"> -1 </code> . </p> <p class="leafygreen-ui-1kp3ins"> MongoDB supports several different index types, including: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-feature-text"> text </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/geospatial-queries/#std-label-index-feature-geospatial"> geospatial </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-hashed/#std-label-index-type-hashed"> hashed indexes </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/#std-label-index-types"> index types </a> for more information. </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-wildcard/#std-label-wildcard-index-core"> Wildcard indexes </a> support workloads where users query against custom fields or a large variety of fields in a collection: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can create a wildcard index on a specific field and its subpaths or on all of the fields in a document. </p> <p class="leafygreen-ui-1kp3ins"> For details see, <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-wildcard/#std-label-wildcard-index-core"> Wildcard Indexes <!-- --> . </a> </p> </li> </ul> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> options </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. A document that contains a set of options that controls the creation of the indexes. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-createIndexes-method-options" target="_self"> <span> Options </span> </a> for details. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-createIndexes-method-commitQuorum" target="_self"> <span> commitQuorum </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer or string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-createIndexes-method-commitQuorum"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. The minimum number of data-bearing voting replica set members (i.e. commit quorum), including the primary, that must report a successful <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-creation/#std-label-index-operations-replicated-build"> index build </a> before the primary marks the <code class="leafygreen-ui-1l06pbn"> indexes </code> as ready. A "voting" member is any replica set member where <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-.votes"> <code class="leafygreen-ui-1l06pbn"> members[n].votes </code> </a> is greater than <code class="leafygreen-ui-1l06pbn"> 0 </code> . </p> <p class="leafygreen-ui-1kp3ins"> Supports the following values: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "votingMembers" </code> - all data-bearing voting replica set members ( <em> Default </em> ). </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> - a simple majority of data-bearing voting replica set members. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;int&gt; </code> - a specific number of data-bearing voting replica set members. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> 0 </code> - Disables quorum-voting behavior. Members start the index build simultaneously but do <em> not </em> vote or wait for quorum before completing the index build. If you start an index build with a commit quorum of <code class="leafygreen-ui-1l06pbn"> 0 </code> , you cannot later modify the commit quorum using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setIndexCommitQuorum/#mongodb-dbcommand-dbcmd.setIndexCommitQuorum"> <code class="leafygreen-ui-1l06pbn"> setIndexCommitQuorum </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A replica set <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-replica-set-tag-sets/#std-label-replica-set-configuration-tag-sets"> tag name <!-- --> . </a> </p> </li> </ul> </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This method is available in deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Stable API <a class="headerlink leafygreen-ui-1kepx47" href="#stable-api" 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="stable-api"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/stable-api/#std-label-stable-api"> Stable API </a> V1: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot specify any of the following fields in the <code class="leafygreen-ui-1l06pbn"> options </code> document <!-- --> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> background </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> bucketSize </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sparse </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> storageEngine </code> </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot create <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/geohaystack/#std-label-index-geohaystack-index"> geoHaystack </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-type-text"> text </a> indexes. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The above unsupported index types are ignored by the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-plans/#std-label-query-plans-query-optimization"> query planner </a> in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/stable-api/#std-label-stable-api-strict-client"> strict mode </a> . For example, attempting to use a <code class="leafygreen-ui-1l06pbn"> sparse </code> index with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.hint/#mongodb-method-cursor.hint"> <code class="leafygreen-ui-1l06pbn"> cursor.hint() </code> </a> will result in the following <code class="leafygreen-ui-1l06pbn"> BadValue </code> error: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"planner returned error :: caused by :: hint provided does not\ncorrespond to an existing index"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">planner returned error :: caused by :: hint provided does not</td></tr><tr class=""><td class="leafygreen-ui-7razhx">correspond to an existing index</td></tr></tbody></table></code></pre> </div> </div> </div> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-createIndexes-method-options"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Options <a class="headerlink leafygreen-ui-1kepx47" href="#options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="options"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> options </code> document contains a set of options that control the creation of the indexes. Different index types can have additional options specific for that type. </p> <p class="leafygreen-ui-1kp3ins"> Multiple index options can be specified in the same document. However, if you specify multiple option documents the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.createIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </span> </a> operation will fail. </p> <p class="leafygreen-ui-1kp3ins"> Consider the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.createIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </span> </a> operation: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.collection.createIndexes(\n [\n {\n \"a\": 1\n },\n {\n \"b\": 1\n }\n ],\n {\n unique: true,\n sparse: true,\n expireAfterSeconds: 3600\n }\n )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">collection</span>.<span class="lg-highlight-title lg-highlight-function">createIndexes</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"a"</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"b"</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">unique</span>: <span class="lg-highlight-literal">true</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sparse</span>: <span class="lg-highlight-literal">true</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">expireAfterSeconds</span>: <span class="lg-highlight-number">3600</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If the options specification had been split into multiple documents like this: <code class="leafygreen-ui-1l06pbn"> { unique: true }, { sparse: true, expireAfterSeconds: 3600 } </code> the index creation operation would have failed. </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"> When you specify options to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.createIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </span> </a> , the options apply to <em> all </em> of the specified indexes. For example, if you specify a collation option, all of the created indexes will include that collation. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.createIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </span> </a> will return an error if you attempt to create indexes with incompatible options or too many arguments. Refer to the option descriptions for more information. </p> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Options for All Index Types <a class="headerlink leafygreen-ui-1kepx47" href="#options-for-all-index-types" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="options-for-all-index-types"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following options are available for all index types unless otherwise specified: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> unique </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Specifies that each index specified in the <code class="leafygreen-ui-1l06pbn"> keyPatterns </code> array is a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-unique/#std-label-index-type-unique"> unique index </a> . Unique indexes will not accept insertion or update of documents where the index key value matches an existing value in the index. </p> <p class="leafygreen-ui-1kp3ins"> Specify <code class="leafygreen-ui-1l06pbn"> true </code> to create a unique index. The default value is <code class="leafygreen-ui-1l06pbn"> false </code> . </p> <p class="leafygreen-ui-1kp3ins"> The option is <em> unavailable </em> for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-hashed/#std-label-index-hashed-index"> hashed indexes <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> name </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The name of the index. If unspecified, MongoDB generates an index name by concatenating the names of the indexed fields and the sort order. </p> <p class="leafygreen-ui-1kp3ins"> Options specified to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.createIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </span> </a> apply to <strong> all </strong> of the index specifications included in the key pattern array. Since index names must be unique, you may only specify name if you are creating a single index using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.createIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> . </span> </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> partialFilterExpression </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-partialFilterExpression"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. If specified, the indexes only reference documents that match the filter expression. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-partial/#std-label-index-type-partial"> Partial Indexes </a> for more information. </p> <p class="leafygreen-ui-1kp3ins"> A filter expression can include: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> equality expressions (i.e. <code class="leafygreen-ui-1l06pbn"> field: value </code> or using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/eq/#mongodb-query-op.-eq"> <code class="leafygreen-ui-1l06pbn"> $eq </code> </a> operator), </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/exists/#mongodb-query-op.-exists"> <code class="leafygreen-ui-1l06pbn"> $exists: true </code> </a> expression, </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/gt/#mongodb-query-op.-gt"> <code class="leafygreen-ui-1l06pbn"> $gt </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/gte/#mongodb-query-op.-gte"> <code class="leafygreen-ui-1l06pbn"> $gte </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/lt/#mongodb-query-op.-lt"> <code class="leafygreen-ui-1l06pbn"> $lt </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/lte/#mongodb-query-op.-lte"> <code class="leafygreen-ui-1l06pbn"> $lte </code> </a> expressions, </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/type/#mongodb-query-op.-type"> <code class="leafygreen-ui-1l06pbn"> $type </code> </a> expressions, </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/and/#mongodb-query-op.-and"> <code class="leafygreen-ui-1l06pbn"> $and </code> </a> operator, </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/or/#mongodb-query-op.-or"> <code class="leafygreen-ui-1l06pbn"> $or </code> </a> operator, </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/in/#mongodb-query-op.-in"> <code class="leafygreen-ui-1l06pbn"> $in </code> </a> operator </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> You can specify a <code class="leafygreen-ui-1l06pbn"> partialFilterExpression </code> option for all MongoDB <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/#std-label-index-types"> index types <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> sparse </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. If <code class="leafygreen-ui-1l06pbn"> true </code> , the indexes only reference documents with the specified fields. These indexes use less space but behave differently in some situations (particularly sorts). The default value is <code class="leafygreen-ui-1l06pbn"> false </code> . See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-sparse/#std-label-index-type-sparse"> Sparse Indexes </a> for more information. </p> <p class="leafygreen-ui-1kp3ins"> The following index types are sparse by default and ignore this option: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index"> 2d </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-type-text"> Text </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For a compound index that includes <code class="leafygreen-ui-1l06pbn"> 2dsphere </code> index keys and keys for other types, only the <code class="leafygreen-ui-1l06pbn"> 2dsphere </code> index fields determine whether the index references a document. </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-partial/#std-label-index-type-partial"> Partial indexes </a> have a superset of the sparse index functionality. Unless your application has a specific requirement, use partial indexes instead of sparse indexes. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Specifies a value, in seconds, as a time to live ( <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-TTL"> TTL </a> ) to control how long MongoDB retains documents in this collection. This option only applies to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-TTL"> TTL </a> indexes. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/expire-data/#std-label-ttl-collections"> Expire Data from Collections by Setting TTL </a> for more information. </p> <p class="leafygreen-ui-1kp3ins"> If you use TTL indexes created before MongoDB 5.0, or if you want to sync data created in MongDB 5.0 with a pre-5.0 installation, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/expire-data/#std-label-expireData-warning"> Indexes Configured Using NaN </a> to avoid misconfiguration issues. </p> <p class="leafygreen-ui-1kp3ins"> The TTL index <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> value must be within <code class="leafygreen-ui-1l06pbn"> 0 </code> and <code class="leafygreen-ui-1l06pbn"> 2147483647 </code> inclusive. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-method-createIndexes-hidden" target="_self"> <span> hidden </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-method-createIndexes-hidden"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. A flag that determines whether the index is <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-hidden/#std-label-index-type-hidden"> hidden </a> from the query planner. A hidden index is not evaluated as part of the query plan selection. </p> <p class="leafygreen-ui-1kp3ins"> Default is <code class="leafygreen-ui-1l06pbn"> false </code> . </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> storageEngine </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Allows users to configure the storage engine for the created indexes. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> storageEngine </code> option should take the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"storageEngine: { &lt;storage-engine-name&gt;: &lt;options&gt; }","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"><span class="lg-highlight-attr">storageEngine</span>: <!-- -->{ &lt;<!-- -->storage<!-- -->-<!-- -->engine<!-- -->-<!-- -->name<!-- -->&gt;<!-- -->: &lt;<!-- -->options<!-- -->&gt; <!-- -->}</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"> Storage engine configuration options specified when creating indexes are validated and logged to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> during replication to support replica sets with members that use different storage engines. </p> </div> </div> </td> </tr> </tbody> </table> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-create-indexes-collation"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Option for Collation <a class="headerlink leafygreen-ui-1kepx47" href="#option-for-collation" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="option-for-collation"> </div> </a> </h3> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> collation </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Specifies the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> collation </a> for the index. </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> Collation </a> allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks. </p> <p class="leafygreen-ui-1kp3ins"> If you have specified a collation at the collection level, then: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you do not specify a collation when creating the index, MongoDB creates the index with the collection's default collation. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you do specify a collation when creating the index, MongoDB creates the index with the specified collation. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The collation option has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collation: {\n locale: &lt;string&gt;,\n caseLevel: &lt;boolean&gt;,\n caseFirst: &lt;string&gt;,\n strength: &lt;int&gt;,\n numericOrdering: &lt;boolean&gt;,\n alternate: &lt;string&gt;,\n maxVariable: &lt;string&gt;,\n backwards: &lt;boolean&gt;\n}"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collation: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> locale: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> caseLevel: &lt;boolean&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> caseFirst: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> strength: &lt;int&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> numericOrdering: &lt;boolean&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> alternate: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> maxVariable: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> backwards: &lt;boolean&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> When specifying collation, the <code class="leafygreen-ui-1l06pbn"> locale </code> field is mandatory; all other collation fields are optional. For descriptions of the fields, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation-document-fields"> Collation Document <!-- --> . </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> The following indexes only support simple binary comparison and do not support <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> collation <!-- --> : </a> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-type-text"> Text </a> indexes </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index"> 2d </a> indexes </p> </li> </ul> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To create a <code class="leafygreen-ui-1l06pbn"> text </code> or <code class="leafygreen-ui-1l06pbn"> 2d </code> index on a collection that has a non-simple collation, you must explicitly specify <code class="leafygreen-ui-1l06pbn"> {collation: {locale: "simple"} } </code> when creating the index. </p> </div> </div> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Collation and Index Use <a class="headerlink leafygreen-ui-1kepx47" href="#collation-and-index-use" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="collation-and-index-use"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> If you have specified a collation at the collection level, then: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you do not specify a collation when creating the index, MongoDB creates the index with the collection's default collation. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you do specify a collation when creating the index, MongoDB creates the index with the specified collation. </p> </li> </ul> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> By specifying a collation <code class="leafygreen-ui-1l06pbn"> strength </code> of <code class="leafygreen-ui-1l06pbn"> 1 </code> or <code class="leafygreen-ui-1l06pbn"> 2 </code> , you can create a case-insensitive index. Index with a collation <code class="leafygreen-ui-1l06pbn"> strength </code> of <code class="leafygreen-ui-1l06pbn"> 1 </code> is both diacritic- and case-insensitive. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> You can create multiple indexes on the same key(s) with different collations. To create indexes with the same key pattern but different collations, you must supply unique index names. </p> <p class="leafygreen-ui-1kp3ins"> To use an index for string comparisons, an operation must also specify the same collation. That is, an index with a collation cannot support an operation that performs string comparisons on the indexed fields if the operation specifies a different collation. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Because indexes that are configured with collation use ICU collation keys to achieve sort order, collation-aware index keys may be larger than index keys for indexes without collation. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For example, the collection <code class="leafygreen-ui-1l06pbn"> myColl </code> has an index on a string field <code class="leafygreen-ui-1l06pbn"> category </code> with the collation locale <code class="leafygreen-ui-1l06pbn"> "fr" </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.createIndex( { category: 1 }, { collation: { locale: \"fr\" } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-number">1</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following query operation, which specifies the same collation as the index, can use the index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { category: \"cafe\" } ).collation( { locale: \"fr\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> } ).<span class="lg-highlight-title lg-highlight-function">collation</span>( <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> However, the following query operation, which by default uses the "simple" binary collator, cannot use the index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { category: \"cafe\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For a compound index where the index prefix keys are not strings, arrays, and embedded documents, an operation that specifies a different collation can still use the index to support comparisons on the index prefix keys. </p> <p class="leafygreen-ui-1kp3ins"> For example, the collection <code class="leafygreen-ui-1l06pbn"> myColl </code> has a compound index on the numeric fields <code class="leafygreen-ui-1l06pbn"> score </code> and <code class="leafygreen-ui-1l06pbn"> price </code> and the string field <code class="leafygreen-ui-1l06pbn"> category </code> ; the index is created with the collation locale <code class="leafygreen-ui-1l06pbn"> "fr" </code> for string comparisons: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.createIndex(\n { score: 1, price: 1, category: 1 },\n { collation: { locale: \"fr\" } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operations, which use <code class="leafygreen-ui-1l06pbn"> "simple" </code> binary collation for string comparisons, can use the index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { score: 5 } ).sort( { price: 1 } )\ndb.myColl.find( { score: 5, price: { $gt: NumberDecimal( \"10\" ) } } ).sort( { price: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">5</span> } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">price</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>( <span class="lg-highlight-string">"10"</span> ) } } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation, which uses <code class="leafygreen-ui-1l06pbn"> "simple" </code> binary collation for string comparisons on the indexed <code class="leafygreen-ui-1l06pbn"> category </code> field, can use the index to fulfill only the <code class="leafygreen-ui-1l06pbn"> score: 5 </code> portion of the query: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { score: 5, category: \"cafe\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Matches against document keys, including embedded document keys, use simple binary comparison. This means that a query for a key like "foo.bár" will not match the key "foo.bar", regardless of the value you set for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation-parameter-strength"> strength </a> parameter. </p> </div> </div> </section> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Options for <code class="leafygreen-ui-1l06pbn"> text </code> Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#options-for-text-indexes" 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="options-for-text-indexes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following options are available for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-type-text"> text </a> indexes only: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> weights </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. For <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-type-text"> text </a> indexes, a document that contains field and weight pairs. The weight is an integer ranging from 1 to 99,999 and denotes the significance of the field relative to the other indexed fields in terms of the score. You can specify weights for some or all the indexed fields. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/control-text-search-results/#std-label-control-text-search-results"> Assign Weights to Text Search Results on Self-Managed Deployments </a> to adjust the scores. The default value is <code class="leafygreen-ui-1l06pbn"> 1 </code> . </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/control-text-search-results/#std-label-specify-weights"> weights </a> option is only allowed for text indexes. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> default_language </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. For <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-type-text"> text </a> indexes, the language that determines the list of stop words and the rules for the stemmer and tokenizer. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/text-search-languages/#std-label-text-search-languages"> Text Search Languages on Self-Managed Deployments </a> for the available languages and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/specify-text-index-language/#std-label-specify-default-text-index-language"> Specify the Default Language for a Text Index on Self-Managed Deployments </a> for more information and examples. The default value is <code class="leafygreen-ui-1l06pbn"> english </code> . </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> language_override </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. For <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-type-text"> text </a> indexes, the name of the field, in the collection's documents, that contains the override language for the document. The default value is <code class="leafygreen-ui-1l06pbn"> language </code> . See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/specify-text-index-language/#std-label-specify-language-field-text-index-example"> Specify the Default Language for a Text Index on Self-Managed Deployments </a> for an example. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> textIndexVersion </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The <code class="leafygreen-ui-1l06pbn"> text </code> index version number. Users can use this option to override the default version number. </p> <p class="leafygreen-ui-1kp3ins"> For available versions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/text-index-versions/#std-label-text-index-versions"> Text Index Versions on Self-Managed Deployments <!-- --> . </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Options for <code class="leafygreen-ui-1l06pbn"> 2dsphere </code> Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#options-for-2dsphere-indexes" 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="options-for-2dsphere-indexes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following option is available for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere </a> indexes only: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 2dsphereIndexVersion </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The <code class="leafygreen-ui-1l06pbn"> 2dsphere </code> index version number. Users can use this option to override the default version number. </p> <p class="leafygreen-ui-1kp3ins"> For the available versions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-v2"> 2dsphere Indexes <!-- --> . </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Options for <code class="leafygreen-ui-1l06pbn"> 2d </code> Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#options-for-2d-indexes" 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="options-for-2d-indexes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following options are available for <code class="leafygreen-ui-1l06pbn"> 2d </code> indexes only: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> bits </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. For <code class="leafygreen-ui-1l06pbn"> 2d </code> indexes, the number of precision of the stored <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-geohash"> geohash </a> value of the location data. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> bits </code> value ranges from 1 to 32 inclusive. The default value is <code class="leafygreen-ui-1l06pbn"> 26 </code> . </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> min </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> number </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. For <code class="leafygreen-ui-1l06pbn"> 2d </code> indexes, the lower inclusive boundary for the longitude and latitude values. The default value is <code class="leafygreen-ui-1l06pbn"> -180.0 </code> . </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> max </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> number </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. For <code class="leafygreen-ui-1l06pbn"> 2d </code> indexes, the upper inclusive boundary for the longitude and latitude values. The default value is <code class="leafygreen-ui-1l06pbn"> 180.0 </code> . </div> </div> </td> </tr> </tbody> </table> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-createIndexes-method-wildcard-option"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Options for <code class="leafygreen-ui-1l06pbn"> wildcard </code> indexes <a class="headerlink leafygreen-ui-1kepx47" href="#options-for-wildcard-indexes" 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="options-for-wildcard-indexes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following option is available for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-wildcard/#std-label-wildcard-index-core"> wildcard </a> indexes only: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Allows users to include or exclude specific field paths from a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-wildcard/#std-label-wildcard-index-core"> wildcard index <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> This option is only valid when you create an <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-wildcard/#std-label-wildcard-index-core"> wildcard index </a> on all document fields. You cannot specify the <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> option when you create a wildcard index on a specific field path and its subfields. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> works with specifications like: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"$**\": 1 }\n{ \"userID\":, \"$**\": 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"$**"</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"userID"</span>:<!-- -->,<!-- --> <span class="lg-highlight-string">"$**"</span>: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> However, you can't define an index that includes the same field in the wildcard fields and the regular (non-wildcard) fields. To define the index correctly, use a <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> to exclude duplicated fields from the wildcard pattern. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> does not work with a specification like: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":" ``{ \"path.to.field.$**\" : 1 }``","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">``</span>{ <span class="lg-highlight-string">"path.to.field.$**"</span> <!-- -->: <span class="lg-highlight-number">1</span> }<span class="lg-highlight-string">``</span></td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> option takes the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"wildcardProjection: {\n \"path.to.field.a\" : &lt;value&gt;,\n \"path.to.field.b\" : &lt;value&gt;\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">wildcardProjection</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"path.to.field.a"</span> <!-- -->: &lt;<!-- -->value<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"path.to.field.b"</span> <!-- -->: &lt;<!-- -->value<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> &lt;value&gt; </code> can be either of the following: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> 1 </code> or <code class="leafygreen-ui-1l06pbn"> true </code> to include the field in the wildcard index. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> 0 </code> or <code class="leafygreen-ui-1l06pbn"> false </code> to exclude the field from the wildcard index. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Wildcard indexes omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field by default. To include the <code class="leafygreen-ui-1l06pbn"> _id </code> field in the wildcard index, you must explicitly include it in the <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"wildcardProjection\" : {\n \"_id\" : 1,\n \"&lt;field&gt;\" : 0|1\n }\n}","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"wildcardProjection"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"_id"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">1</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"&lt;field&gt;"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">0</span>|<span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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"> All of the statements in the <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> document must be either inclusion or exclusion statements. You can also include the <code class="leafygreen-ui-1l06pbn"> _id </code> field with exclusion statements. This is the only exception to the rule. </p> <p class="leafygreen-ui-1kp3ins"> Options specified to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.createIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </span> </a> apply to <strong> all </strong> of the index specifications included in the key pattern array. Specify <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> only if you are creating a single wildcard index using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.createIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> . </span> </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behaviors <a class="headerlink leafygreen-ui-1kepx47" href="#behaviors" 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="behaviors"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Recreating an Existing Index <a class="headerlink leafygreen-ui-1kepx47" href="#recreating-an-existing-index" 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="recreating-an-existing-index"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you call <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.createIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </span> </a> for an index or indexes that already exist, MongoDB does not recreate the existing index or indexes. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Index Options <a class="headerlink leafygreen-ui-1kepx47" href="#index-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="index-options"> </div> </a> </h3> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Non-Collation and Non-Hidden Options <a class="headerlink leafygreen-ui-1kepx47" href="#non-collation-and-non-hidden-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="non-collation-and-non-hidden-options"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> With the exception of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-method-createIndexes-collation-option" target="_self"> <span> collation option </span> </a> , if you create an index with one set of index options and then try to recreate the same index but with different index options, MongoDB will not change the options nor recreate the index. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createIndexes/#std-label-createIndexes-hidden-option"> hidden </a> option can be changed without dropping and recreating the index. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-method-createIndexes-hidden-option" target="_self"> <span> Hidden Option <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> To change the other index options, drop the existing index with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.dropIndex/#mongodb-method-db.collection.dropIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </a> before running <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.createIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </span> </a> with the new options. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-method-createIndexes-collation-option"> </span> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Collation Option <a class="headerlink leafygreen-ui-1kepx47" href="#collation-option" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="collation-option"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> You can create multiple indexes on the same key(s) with different collations. To create indexes with the same key pattern but different collations, you must supply unique index names. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-method-createIndexes-hidden-option"> </span> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Hidden Option <a class="headerlink leafygreen-ui-1kepx47" href="#hidden-option" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="hidden-option"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> To hide or unhide existing indexes, you can use the following <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> methods: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.hideIndex/#mongodb-method-db.collection.hideIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.hideIndex() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.unhideIndex/#mongodb-method-db.collection.unhideIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.unhideIndex() </code> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For example, </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To change the <code class="leafygreen-ui-1l06pbn"> hidden </code> option for an index to <code class="leafygreen-ui-1l06pbn"> true </code> , use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.hideIndex/#mongodb-method-db.collection.hideIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.hideIndex() </code> </a> method: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.restaurants.hideIndex( { borough: 1, ratings: 1 } );","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">restaurants</span>.<span class="lg-highlight-title lg-highlight-function">hideIndex</span>( <!-- -->{ <span class="lg-highlight-attr">borough</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">ratings</span>: <span class="lg-highlight-number">1</span> } )<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To change the <code class="leafygreen-ui-1l06pbn"> hidden </code> option for an index to <code class="leafygreen-ui-1l06pbn"> false </code> , use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.unhideIndex/#mongodb-method-db.collection.unhideIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.unhideIndex() </code> </a> method: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.restaurants.unhideIndex( { borough: 1, city: 1 } );","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">restaurants</span>.<span class="lg-highlight-title lg-highlight-function">unhideIndex</span>( <!-- -->{ <span class="lg-highlight-attr">borough</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-number">1</span> } )<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ul> <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/index-hidden/#std-label-index-type-hidden"> Hidden Indexes </a> </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-createIndexes-method-wildcard-behavior"> </span> </section> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Wildcard Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#wildcard-indexes" 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="wildcard-indexes"> </div> </a> </h3> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Wildcard indexes omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field by default. To include the <code class="leafygreen-ui-1l06pbn"> _id </code> field in the wildcard index, you must explicitly include it in the <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"wildcardProjection\" : {\n \"_id\" : 1,\n \"&lt;field&gt;\" : 0|1\n }\n}","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"wildcardProjection"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"_id"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">1</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"&lt;field&gt;"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">0</span>|<span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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"> All of the statements in the <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> document must be either inclusion or exclusion statements. You can also include the <code class="leafygreen-ui-1l06pbn"> _id </code> field with exclusion statements. This is the only exception to the rule. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Wildcard indexes do not support: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/internals/#std-label-2d-index-internals"> 2d (Geospatial) indexes </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere (Geospatial) indexes </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-hashed/#std-label-index-type-hashed"> Hashed indexes </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-ttl/#std-label-index-feature-ttl"> Time to Live (TTL) indexes </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-feature-text"> Text indexes </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-unique/#std-label-index-type-unique"> Unique indexes </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Wildcard indexes are <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-sparse/#std-label-index-type-sparse"> sparse </a> indexes. They do not support queries when an indexed field does not exist. A wildcard index will index the document if the wildcard field has a <code class="leafygreen-ui-1l06pbn"> null </code> value. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 7.0, wildcard indexes support ascending ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ) and descending ( <code class="leafygreen-ui-1l06pbn"> -1 </code> ) sort order. Earlier versions only supported ascending order. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> To learn more, see: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-wildcard/#std-label-wildcard-index-core"> Concepts </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createIndexes/#std-label-createIndexes-command-wildcard-examples"> Examples </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-wildcard/reference/restrictions/#std-label-wildcard-index-restrictions"> Restrictions </a> </p> </li> </ul> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Transactions <a class="headerlink leafygreen-ui-1kepx47" href="#transactions" 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="transactions"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can create collections and indexes inside a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions-create-collections-indexes"> distributed transaction </a> if the transaction is <strong class="css-4dei7l"> not </strong> a cross-shard write transaction. </p> <p class="leafygreen-ui-1kp3ins"> To use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.createIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </span> </a> in a transaction, the transaction must use read concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-local/#mongodb-readconcern-readconcern.-local-"> <code class="leafygreen-ui-1l06pbn"> "local" </code> </a> . If you specify a read concern level other than <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-local/#mongodb-readconcern-readconcern.-local-"> <code class="leafygreen-ui-1l06pbn"> "local" </code> </a> , the transaction fails. </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/transactions/#std-label-transactions-create-collections-indexes"> Create Collections and Indexes in a Transaction </a> </p> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Index Builds <a class="headerlink leafygreen-ui-1kepx47" href="#index-builds" 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="index-builds"> </div> </a> </h3> <div> <p> <em> Changed <!-- --> in version <!-- --> 7.1 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 7.1, index builds are improved with faster error reporting and increased failure resilience. You can also set the minimum available disk space required for index builds using the new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.indexBuildMinAvailableDiskSpaceMB"> <code class="leafygreen-ui-1l06pbn"> indexBuildMinAvailableDiskSpaceMB </code> </a> parameter, which stops index builds if disk space is too low. </p> <p class="leafygreen-ui-1kp3ins"> The following table compares the index build behavior starting in MongoDB 7.1 with earlier versions. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:50%"/> <col style="width:50%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Behavior Starting in MongoDB 7.1 </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Behavior in Earlier MongoDB Versions </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Index errors found during the collection scan phase, except duplicate key errors, are returned immediately and then the index build stops. Earlier MongoDB versions return errors in the commit phase, which occurs near the end of the index build. MongoDB 7.1 helps you to rapidly diagnose index errors. For example, if an incompatible index value format is found, the error is returned to you immediately. </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Index build errors can take a long time to be returned compared to MongoDB 7.1 because the errors are returned near the end of the index build in the commit phase. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Increased resilience for your deployment. If an index build error occurs, a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondary </a> member can request that the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> member stop an index build and the secondary member does not crash. A request to stop an index build is not always possible: if a member has already voted to commit the index, then the secondary cannot request that the index build stop and the secondary crashes (similar to MongoDB 7.0 and earlier). </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An index build error can cause a secondary member to crash. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Improved disk space management for index builds. An index build may be automatically stopped if the available disk space is below the minimum specified in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.indexBuildMinAvailableDiskSpaceMB"> <code class="leafygreen-ui-1l06pbn"> indexBuildMinAvailableDiskSpaceMB </code> </a> parameter. If a member has already voted to commit the index, then the index build is not stopped. </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An index build is not stopped if there is insufficient available disk space. </div> </div> </td> </tr> </tbody> </table> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <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/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndex() </code> </a> for examples of various index specifications. </p> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create Indexes Without Options <a class="headerlink leafygreen-ui-1kepx47" href="#create-indexes-without-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-indexes-without-options"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Consider a <code class="leafygreen-ui-1l06pbn"> restaurants </code> collection containing documents that resemble the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n location: {\n type: \"Point\",\n coordinates: [-73.856077, 40.848447]\n },\n name: \"Morris Park Bake Shop\",\n cuisine: \"Cafe\",\n borough: \"Bronx\",\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">location</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Point"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">coordinates</span>: <!-- -->[<!-- -->-<span class="lg-highlight-number">73.856077</span>, <span class="lg-highlight-number">40.848447</span>]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">"Morris Park Bake Shop"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">cuisine</span>: <span class="lg-highlight-string">"Cafe"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">borough</span>: <span class="lg-highlight-string">"Bronx"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example creates two indexes on the <code class="leafygreen-ui-1l06pbn"> restaurants </code> collection: an ascending index on the <code class="leafygreen-ui-1l06pbn"> borough </code> field and a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere </a> index on the <code class="leafygreen-ui-1l06pbn"> location </code> field. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.restaurants.createIndexes([{\"borough\": 1}, {\"location\": \"2dsphere\"}])","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.restaurants.createIndexes([{<span class="lg-highlight-string">"borough"</span>: 1}, {<span class="lg-highlight-string">"location"</span>: <span class="lg-highlight-string">"2dsphere"</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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create Indexes with Collation Specified <a class="headerlink leafygreen-ui-1kepx47" href="#create-indexes-with-collation-specified" 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-indexes-with-collation-specified"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example creates two indexes on the <code class="leafygreen-ui-1l06pbn"> products </code> collection: an ascending index on the <code class="leafygreen-ui-1l06pbn"> manufacturer </code> field and an ascending index on the <code class="leafygreen-ui-1l06pbn"> category </code> field. Both indexes use a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#std-label-create-index-collation"> collation </a> that specifies the locale <code class="leafygreen-ui-1l06pbn"> fr </code> and comparison strength <code class="leafygreen-ui-1l06pbn"> 2 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products.createIndexes( [ { \"manufacturer\": 1}, { \"category\": 1 } ],\n { collation: { locale: \"fr\", strength: 2 } })","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products</span>.<span class="lg-highlight-title lg-highlight-function">createIndexes</span>( <!-- -->[ <!-- -->{ <span class="lg-highlight-string">"manufacturer"</span>: <span class="lg-highlight-number">1</span>}<!-- -->, <!-- -->{ <span class="lg-highlight-string">"category"</span>: <span class="lg-highlight-number">1</span> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span>, <span class="lg-highlight-attr">strength</span>: <span class="lg-highlight-number">2</span> } })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For queries or sort operations on the indexed keys that uses the same collation rules, MongoDB can use the index. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#std-label-createIndex-collation-index-use"> Collation and Index Use <!-- --> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-createIndexes-method-wildcard-examples"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create a Wildcard Index <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-wildcard-index" 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-wildcard-index"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> For complete documentation on Wildcard Indexes, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-wildcard/#std-label-wildcard-index-core"> Wildcard Indexes <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The following lists examples of wildcard index creation: </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="#std-label-createIndexes-method-onepath" target="_self"> <span> Create a Wildcard Index on a Single Field Path </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-createIndexes-method-allpaths" target="_self"> <span> Create a Wildcard Index on All Field Paths </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-createIndexes-method-inclusion" target="_self"> <span> Create a Wildcard Index on Multiple Specific Field Paths </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-createIndexes-method-exclusion" target="_self"> <span> Omit Specific Fields from Wildcard Index Coverage </span> </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-createIndexes-method-onepath"> </span> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Create a Wildcard Index on a Single Field Path <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-wildcard-index-on-a-single-field-path" 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-wildcard-index-on-a-single-field-path"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Consider a collection <code class="leafygreen-ui-1l06pbn"> products_catalog </code> where documents may contain a <code class="leafygreen-ui-1l06pbn"> product_attributes </code> field. The <code class="leafygreen-ui-1l06pbn"> product_attributes </code> field can contain arbitrary nested fields, including embedded documents and arrays: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products_catalog.insertMany( [\n {\n _id : ObjectId(\"5c1d358bf383fbee028aea0b\"),\n product_name: \"Blaster Gauntlet\",\n product_attributes: {\n price: {\n cost: 299.99,\n currency: \"USD\"\n }\n }\n },\n {\n _id: ObjectId(\"5c1d358bf383fbee028aea0c\"),\n product_name: \"Super Suit\",\n product_attributes: {\n superFlight: true,\n resistance: [ \"Bludgeoning\", \"Piercing\", \"Slashing\" ]\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products_catalog</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->_id <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"5c1d358bf383fbee028aea0b"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_name</span>: <span class="lg-highlight-string">"Blaster Gauntlet"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_attributes</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">price</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">cost</span>: <span class="lg-highlight-number">299.99</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">currency</span>: <span class="lg-highlight-string">"USD"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"5c1d358bf383fbee028aea0c"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_name</span>: <span class="lg-highlight-string">"Super Suit"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_attributes</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">superFlight</span>: <span class="lg-highlight-literal">true</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">resistance</span>: <!-- -->[ <span class="lg-highlight-string">"Bludgeoning"</span>, <span class="lg-highlight-string">"Piercing"</span>, <span class="lg-highlight-string">"Slashing"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation creates a wildcard index on the <code class="leafygreen-ui-1l06pbn"> product_attributes </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use inventory\ndb.products_catalog.createIndexes(\n [ { \"product_attributes.$**\" : 1 } ]\n)","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">use inventory</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.products_catalog.createIndexes(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [ { <span class="lg-highlight-string">"product_attributes.$**"</span> : 1 } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> With this wildcard index, MongoDB indexes all scalar values of <code class="leafygreen-ui-1l06pbn"> product_attributes </code> . If the field is a nested document or array, the wildcard index recurses into the document/array and indexes all scalar fields in the document/array. </p> <p class="leafygreen-ui-1kp3ins"> The wildcard index can support arbitrary single-field queries on <code class="leafygreen-ui-1l06pbn"> product_attributes </code> or one of its nested fields: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products_catalog.find( { \"product_attributes.superFlight\" : true } )\ndb.products_catalog.find( { \"product_attributes.maxSpeed\" : { $gt : 20 } } )\ndb.products_catalog.find( { \"product_attributes.elements\" : { $eq: \"water\" } } )","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.products_catalog.find( { <span class="lg-highlight-string">"product_attributes.superFlight"</span> : <span class="lg-highlight-literal">true</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.products_catalog.find( { <span class="lg-highlight-string">"product_attributes.maxSpeed"</span> : { <span class="lg-highlight-variable">$gt</span> : 20 } } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.products_catalog.find( { <span class="lg-highlight-string">"product_attributes.elements"</span> : { <span class="lg-highlight-variable">$eq</span>: <span class="lg-highlight-string">"water"</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-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The path-specific wildcard index syntax is incompatible with the <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> option. See the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-createIndexes-method-wildcard-option" target="_self"> <span> parameter documentation </span> </a> for more information. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-createIndexes-method-allpaths"> </span> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Create a Wildcard Index on All Field Paths <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-wildcard-index-on-all-field-paths" 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-wildcard-index-on-all-field-paths"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Consider a collection <code class="leafygreen-ui-1l06pbn"> products_catalog </code> where documents may contain a <code class="leafygreen-ui-1l06pbn"> product_attributes </code> field. The <code class="leafygreen-ui-1l06pbn"> product_attributes </code> field can contain arbitrary nested fields, including embedded documents and arrays: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products_catalog.insertMany( [\n {\n _id : ObjectId(\"5c1d358bf383fbee028aea0b\"),\n product_name: \"Blaster Gauntlet\",\n product_attributes: {\n price: {\n cost: 299.99,\n currency: \"USD\"\n }\n }\n },\n {\n _id: ObjectId(\"5c1d358bf383fbee028aea0c\"),\n product_name: \"Super Suit\",\n product_attributes: {\n superFlight: true,\n resistance: [ \"Bludgeoning\", \"Piercing\", \"Slashing\" ]\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products_catalog</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->_id <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"5c1d358bf383fbee028aea0b"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_name</span>: <span class="lg-highlight-string">"Blaster Gauntlet"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_attributes</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">price</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">cost</span>: <span class="lg-highlight-number">299.99</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">currency</span>: <span class="lg-highlight-string">"USD"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"5c1d358bf383fbee028aea0c"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_name</span>: <span class="lg-highlight-string">"Super Suit"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_attributes</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">superFlight</span>: <span class="lg-highlight-literal">true</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">resistance</span>: <!-- -->[ <span class="lg-highlight-string">"Bludgeoning"</span>, <span class="lg-highlight-string">"Piercing"</span>, <span class="lg-highlight-string">"Slashing"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation creates a wildcard index on all scalar fields (excluding the <code class="leafygreen-ui-1l06pbn"> _id </code> field): </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use inventory\ndb.products_catalog.createIndexes( [ { \"$**\" : 1 } ] )","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">use inventory</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.products_catalog.createIndexes( [ { <span class="lg-highlight-string">"$**"</span> : 1 } ] )</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"> With this wildcard index, MongoDB indexes all scalar fields for each document in the collection. If a given field is a nested document or array, the wildcard index recurses into the document/array and indexes all scalar fields in the document/array. </p> <p class="leafygreen-ui-1kp3ins"> The created index can support queries on any arbitrary field within documents in the collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products_catalog.find( { \"product_price\" : { $lt : 25 } } )\ndb.products_catalog.find( { \"product_attributes.elements\" : { $eq: \"water\" } } )","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.products_catalog.find( { <span class="lg-highlight-string">"product_price"</span> : { <span class="lg-highlight-variable">$lt</span> : 25 } } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.products_catalog.find( { <span class="lg-highlight-string">"product_attributes.elements"</span> : { <span class="lg-highlight-variable">$eq</span>: <span class="lg-highlight-string">"water"</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-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Wildcard indexes omit the <code class="leafygreen-ui-1l06pbn"> _id </code> field by default. To include the <code class="leafygreen-ui-1l06pbn"> _id </code> field in the wildcard index, you must explicitly include it in the <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> document. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-createIndexes-method-wildcard-option" target="_self"> <span> parameter documentation </span> </a> for more information. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-createIndexes-method-inclusion"> </span> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Create a Wildcard Index on Multiple Specific Field Paths <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-wildcard-index-on-multiple-specific-field-paths" 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-wildcard-index-on-multiple-specific-field-paths"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Consider a collection <code class="leafygreen-ui-1l06pbn"> products_catalog </code> where documents may contain a <code class="leafygreen-ui-1l06pbn"> product_attributes </code> field. The <code class="leafygreen-ui-1l06pbn"> product_attributes </code> field can contain arbitrary nested fields, including embedded documents and arrays: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products_catalog.insertMany( [\n {\n _id : ObjectId(\"5c1d358bf383fbee028aea0b\"),\n product_name: \"Blaster Gauntlet\",\n product_attributes: {\n price: {\n cost: 299.99,\n currency: \"USD\"\n }\n }\n },\n {\n _id: ObjectId(\"5c1d358bf383fbee028aea0c\"),\n product_name: \"Super Suit\",\n product_attributes: {\n superFlight: true,\n resistance: [ \"Bludgeoning\", \"Piercing\", \"Slashing\" ]\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products_catalog</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->_id <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"5c1d358bf383fbee028aea0b"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_name</span>: <span class="lg-highlight-string">"Blaster Gauntlet"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_attributes</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">price</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">cost</span>: <span class="lg-highlight-number">299.99</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">currency</span>: <span class="lg-highlight-string">"USD"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"5c1d358bf383fbee028aea0c"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_name</span>: <span class="lg-highlight-string">"Super Suit"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_attributes</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">superFlight</span>: <span class="lg-highlight-literal">true</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">resistance</span>: <!-- -->[ <span class="lg-highlight-string">"Bludgeoning"</span>, <span class="lg-highlight-string">"Piercing"</span>, <span class="lg-highlight-string">"Slashing"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation creates a wildcard index and uses the <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> option to include only scalar values of the <code class="leafygreen-ui-1l06pbn"> product_attributes.elements </code> and <code class="leafygreen-ui-1l06pbn"> product_attributes.resistance </code> fields in the index. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use inventory\ndb.products_catalog.createIndexes(\n [ { \"$**\" : 1 } ],\n {\n \"wildcardProjection\" : {\n \"product_attributes.elements\" : 1,\n \"product_attributes.resistance\" : 1\n }\n }\n)","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">use inventory</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.products_catalog.createIndexes(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [ { <span class="lg-highlight-string">"$**"</span> : 1 } ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"wildcardProjection"</span> : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"product_attributes.elements"</span> : 1,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"product_attributes.resistance"</span> : 1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The pattern <code class="leafygreen-ui-1l06pbn"> "$**" </code> includes all fields in the document. Use the <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> field to limit the index to the specified fields. </p> <p class="leafygreen-ui-1kp3ins"> For complete documentation on <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#std-label-createIndex-method-wildcard-option"> Options for <code class="leafygreen-ui-1l06pbn"> wildcard </code> indexes <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If a field is a nested document or array, the wildcard index recurses into the document/array and indexes all scalar fields in the document/array. </p> <p class="leafygreen-ui-1kp3ins"> The wildcard index supports queries on any scalar field included in the <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products_catalog.find( { \"product_attributes.elements\" : { $eq: \"Water\" } } )\ndb.products_catalog.find( { \"product_attributes.resistance\" : \"Bludgeoning\" } )","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.products_catalog.find( { <span class="lg-highlight-string">"product_attributes.elements"</span> : { <span class="lg-highlight-variable">$eq</span>: <span class="lg-highlight-string">"Water"</span> } } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.products_catalog.find( { <span class="lg-highlight-string">"product_attributes.resistance"</span> : <span class="lg-highlight-string">"Bludgeoning"</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-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Wildcard indexes do not support mixing inclusion and exclusion statements in the <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> document <em> except </em> when explicitly including the <code class="leafygreen-ui-1l06pbn"> _id </code> field. For more information on <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> , see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-createIndexes-method-wildcard-option" target="_self"> <span> parameter documentation </span> </a> . </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-createIndexes-method-exclusion"> </span> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Omit Specific Fields from Wildcard Index Coverage <a class="headerlink leafygreen-ui-1kepx47" href="#omit-specific-fields-from-wildcard-index-coverage" 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="omit-specific-fields-from-wildcard-index-coverage"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Consider a collection <code class="leafygreen-ui-1l06pbn"> products_catalog </code> where documents may contain a <code class="leafygreen-ui-1l06pbn"> product_attributes </code> field. The <code class="leafygreen-ui-1l06pbn"> product_attributes </code> field can contain arbitrary nested fields, including embedded documents and arrays: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products_catalog.insertMany( [\n {\n _id : ObjectId(\"5c1d358bf383fbee028aea0b\"),\n product_name: \"Blaster Gauntlet\",\n product_attributes: {\n price: {\n cost: 299.99,\n currency: \"USD\"\n }\n }\n },\n {\n _id: ObjectId(\"5c1d358bf383fbee028aea0c\"),\n product_name: \"Super Suit\",\n product_attributes: {\n superFlight: true,\n resistance: [ \"Bludgeoning\", \"Piercing\", \"Slashing\" ]\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products_catalog</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->_id <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"5c1d358bf383fbee028aea0b"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_name</span>: <span class="lg-highlight-string">"Blaster Gauntlet"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_attributes</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">price</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">cost</span>: <span class="lg-highlight-number">299.99</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">currency</span>: <span class="lg-highlight-string">"USD"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"5c1d358bf383fbee028aea0c"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_name</span>: <span class="lg-highlight-string">"Super Suit"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">product_attributes</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">superFlight</span>: <span class="lg-highlight-literal">true</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">resistance</span>: <!-- -->[ <span class="lg-highlight-string">"Bludgeoning"</span>, <span class="lg-highlight-string">"Piercing"</span>, <span class="lg-highlight-string">"Slashing"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This example uses a wildcard index and a <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> document to index the scalar fields for each document in the collection. The wildcard index excludes the <code class="leafygreen-ui-1l06pbn"> product_attributes.elements </code> and <code class="leafygreen-ui-1l06pbn"> product_attributes.resistance </code> fields: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use inventory\ndb.products_catalog.createIndexes(\n [ { \"$**\" : 1 } ],\n {\n \"wildcardProjection\" : {\n \"product_attributes.elements\" : 0,\n \"product_attributes.resistance\" : 0\n }\n }\n)","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">use inventory</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.products_catalog.createIndexes(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [ { <span class="lg-highlight-string">"$**"</span> : 1 } ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"wildcardProjection"</span> : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"product_attributes.elements"</span> : 0,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"product_attributes.resistance"</span> : 0</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The wildcard pattern <code class="leafygreen-ui-1l06pbn"> "$**" </code> includes all of the fields in the document. However, the <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> field excludes the specified fields from the index. </p> <p class="leafygreen-ui-1kp3ins"> For complete documentation on <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#std-label-createIndex-method-wildcard-option"> Options for <code class="leafygreen-ui-1l06pbn"> wildcard </code> indexes <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If a field is a nested document or array, the wildcard index recurses into the document/array and indexes all scalar fields in the document/array. </p> <p class="leafygreen-ui-1kp3ins"> The index can support queries on any scalar field <strong> except </strong> fields that are excluded by <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products_catalog.find( { \"product_attributes.maxSpeed\" : { $gt: 25 } } )\ndb.products_catalog.find( { \"product_attributes.superStrength\" : true } )","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.products_catalog.find( { <span class="lg-highlight-string">"product_attributes.maxSpeed"</span> : { <span class="lg-highlight-variable">$gt</span>: 25 } } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.products_catalog.find( { <span class="lg-highlight-string">"product_attributes.superStrength"</span> : <span class="lg-highlight-literal">true</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-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Wildcard indexes do not support mixing inclusion and exclusion statements in the <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> document <em> except </em> when explicitly including the <code class="leafygreen-ui-1l06pbn"> _id </code> field. For more information on <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> , see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-createIndexes-method-wildcard-option" target="_self"> <span> parameter documentation </span> </a> . </p> </div> </div> </section> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create Indexes With Commit Quorum <a class="headerlink leafygreen-ui-1kepx47" href="#create-indexes-with-commit-quorum" 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-indexes-with-commit-quorum"> </div> </a> </h3> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Requires featureCompatibilityVersion 4.4+ </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Each <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> in the replica set or sharded cluster <em> must </em> have <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-set-fcv"> featureCompatibilityVersion </a> set to at least <code class="leafygreen-ui-1l06pbn"> 4.4 </code> to start index builds simultaneously across replica set members. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Index builds on a replica set or sharded cluster build simultaneously across all data-bearing replica set members. For sharded clusters, the index build occurs only on shards containing data for the collection being indexed. The primary requires a minimum number of data-bearing <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-.votes"> <code class="leafygreen-ui-1l06pbn"> voting </code> </a> members (i.e commit quorum), including itself, that must complete the build before marking the index as ready for use. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-creation/#std-label-index-operations-replicated-build"> Index Builds in Replicated Environments </a> for more information. </p> <p class="leafygreen-ui-1kp3ins"> To set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createIndexes/#std-label-createIndexes-cmd-commitQuorum"> commit quorum </a> , use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.createIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> createIndexes() </code> </span> </a> to specify the <code class="leafygreen-ui-1l06pbn"> commitQuorum </code> value. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> commitQuorum </code> specifies how many data-bearing voting members, or which voting members, including the primary, must be prepared to commit the index build before the primary will execute the commit. The default commit quorum is <code class="leafygreen-ui-1l06pbn"> votingMembers </code> , which means all data-bearing members. </p> <p class="leafygreen-ui-1kp3ins"> The following operation creates an index with a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-createIndexes-method-commitQuorum" target="_self"> <span> commit quorum </span> </a> of <code class="leafygreen-ui-1l06pbn"> "majority" </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.getSiblingDB(\"examples\").invoices.createIndexes(\n { \"invoices\" : 1 },\n { },\n \"majority\"\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<span class="lg-highlight-string">"examples"</span>).<span class="lg-highlight-property">invoices</span>.<span class="lg-highlight-title lg-highlight-function">createIndexes</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"invoices"</span> <!-- -->: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"majority"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> marks index build as ready only after a simple majority of data-bearing voting members "vote" to commit the index build. For more information on index builds and the voting process, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-creation/#std-label-index-operations-replicated-build"> Index Builds in Replicated Environments <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create Multiple Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#create-multiple-indexes" 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-multiple-indexes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Create a <code class="leafygreen-ui-1l06pbn"> cakeSales </code> collection that contains cake sales in the states of California ( <code class="leafygreen-ui-1l06pbn"> CA </code> ) and Washington ( <code class="leafygreen-ui-1l06pbn"> WA </code> ): </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.insertMany( [\n { _id: 0, type: \"chocolate\", orderDate: new Date(\"2020-05-18T14:10:30Z\"),\n state: \"CA\", price: 13, quantity: 120 },\n { _id: 1, type: \"chocolate\", orderDate: new Date(\"2021-03-20T11:30:05Z\"),\n state: \"WA\", price: 14, quantity: 140 },\n { _id: 2, type: \"vanilla\", orderDate: new Date(\"2021-01-11T06:31:15Z\"),\n state: \"CA\", price: 12, quantity: 145 },\n { _id: 3, type: \"vanilla\", orderDate: new Date(\"2020-02-08T13:13:23Z\"),\n state: \"WA\", price: 13, quantity: 104 },\n { _id: 4, type: \"strawberry\", orderDate: new Date(\"2019-05-18T16:09:01Z\"),\n state: \"CA\", price: 41, quantity: 162 },\n { _id: 5, type: \"strawberry\", orderDate: new Date(\"2019-01-08T06:12:03Z\"),\n state: \"WA\", price: 43, quantity: 134 }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">120</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">140</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">145</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">104</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">162</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">134</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example creates multiple indexes on the <code class="leafygreen-ui-1l06pbn"> cakeSales </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.createIndexes( [\n { \"type\": 1 },\n { \"orderDate\": 1 },\n { \"state\": 1 },\n { \"orderDate\": 1, \"state\": -1 }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">createIndexes</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"type"</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"orderDate"</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"state"</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"orderDate"</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"state"</span>: <!-- -->-<span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The first three indexes are on single fields and in ascending order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ). </p> <p class="leafygreen-ui-1kp3ins"> The last index is on <code class="leafygreen-ui-1l06pbn"> orderDate </code> in ascending order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ) and <code class="leafygreen-ui-1l06pbn"> state </code> in descending order ( <code class="leafygreen-ui-1l06pbn"> -1 </code> ). </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Additional Information <a class="headerlink leafygreen-ui-1kepx47" href="#additional-information" 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="additional-information"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> For additional information about indexes, refer to: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/indexes/#std-label-indexes"> Indexes </a> section of this manual for full documentation of indexes and indexing in MongoDB. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.getIndexes/#mongodb-method-db.collection.getIndexes"> <code class="leafygreen-ui-1l06pbn"> db.collection.getIndexes() </code> </a> to view the specifications of existing indexes for a collection. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-feature-text"> Text Indexes on Self-Managed Deployments </a> for details on creating <code class="leafygreen-ui-1l06pbn"> text </code> indexes. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/geospatial-queries/#std-label-index-feature-geospatial"> Geospatial Indexes </a> for geospatial queries. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-ttl/#std-label-index-feature-ttl"> TTL Indexes </a> for expiration of data. </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/sh.checkMetadataConsistency/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> sh.checkMetadataConsistency() <a class="headerlink leafygreen-ui-1kepx47" href="#sh.checkmetadataconsistency--" 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="sh.checkmetadataconsistency--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> sh.checkMetadataConsistency(options) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-sh.checkMetadataConsistency" 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-method-sh.checkMetadataConsistency"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Performs a series of consistency checks on sharding metadata for the cluster. This method returns a cursor with either all or a batch of the inconsistency results found. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> mongosh Method </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page documents 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> method. This is <em> not </em> the documentation for database commands or language-specific drivers, such as Node.js. </p> <p class="leafygreen-ui-1kp3ins"> For the database command, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/checkMetadataConsistency/#mongodb-dbcommand-dbcmd.checkMetadataConsistency"> <code class="leafygreen-ui-1l06pbn"> checkMetadataConsistency </code> </a> command <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB API drivers, refer to the language-specific <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB driver documentation <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Run this method after major maintenance operations, such as upgrades and downgrades, or to check if the cluster metadata is inconsistent or corrupted due to bugs in previous releases of MongoDB. </p> <p class="leafygreen-ui-1kp3ins"> By default, the method does not check indexes for consistency across the shards. Index checks can return false positive inconsistencies if they run concurrent with operations that create, delete, or modify indexes. To check indexes with this method, set the <code class="leafygreen-ui-1l06pbn"> checkIndexes </code> option. </p> <p class="leafygreen-ui-1kp3ins"> For more information on the inconsistencies this method checks for, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/inconsistency-type/#std-label-inconsistency-types"> Inconsistency Types <!-- --> . </a> </p> <table class="css-11h39yh e1nex8bq0"> <colgroup> <col class="field-name"/> <col class="field-body"/> </colgroup> <tbody> <tr class="css-x8snli"> <th> Returns <!-- --> : </th> <td> This method returns a cursor with a <code class="leafygreen-ui-1l06pbn"> documents </code> array, which contains a document for each inconsistency found in the sharding metadata. </td> </tr> </tbody> </table> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This method is available in deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-sh.checkMetadataConsistency" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> sh.checkMetadataConsistency() </code> </span> </a> method has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.checkMetadataConsistency( { &lt;options&gt; } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">checkMetadataConsistency</span>( <!-- -->{ &lt;<!-- -->options<!-- -->&gt; <!-- -->} )</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 <code class="leafygreen-ui-1l06pbn"> options </code> document can take the following fields and values: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:15%"/> <col style="width:60%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> checkIndexes </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Sets whether the command also checks indexes in sharding metadata. </p> <p class="leafygreen-ui-1kp3ins"> By default, this operation is disabled, because if it can return false positives inconsistencies when run concurrent with operations that create, delete, or modify indexes. Only check indexes at times when you know these operations are unlikely to occur. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> cursor </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Configures the return cursor. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> cursor.batchSize </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Maximum number of sharding metadata inconsistency documents to include in each batch. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <div class="css-1f5771r"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.checkMetadataConsistency()","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">checkMetadataConsistency</span>(<!-- -->)</td></tr></tbody></table></code></pre> </div> </div> </div> <div class="css-9st569 efa38qy0" style="--border-color:#E8EDEB"> <button aria-disabled="false" class="lg-ui-button-0000 leafygreen-ui-hix6y6" data-lgid="lg-button" role="button" type="button"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg alt="" aria-hidden="true" class="leafygreen-ui-hjnzs9" fill="none" height="16" role="presentation" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M14.364 10.778a1 1 0 0 0 0-1.414l-4.95-4.95-.707-.707a1 1 0 0 0-1.414 0l-.707.707-4.95 4.95a1 1 0 0 0 0 1.414l.707.707a1 1 0 0 0 1.414 0L8 7.243l4.243 4.242a1 1 0 0 0 1.414 0l.707-.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> HIDE OUTPUT </div> </button> </div> <div class="leafygreen-ui-1oteowz"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n cursorHasMore: false,\n documents: [\n {\n type: \"MisplacedCollection\",\n description: \"Unsharded collection found on shard different from database primary shard\",\n details: {\n namespace: \"test.authors\",\n shard: \"shard02\",\n localUUID: new UUID(\"1ad56770-61e2-48e9-83c6-8ecefe73cfc4\")\n }\n }\n ],\n}","programmingLanguage":"JSON"} </script> <div class="css-1sax7hu e11q6jfk0" style="--code-container-border:initial;--code-pre-border:none"> <div class="leafygreen-ui-1fyvhqe"> <div class="leafygreen-ui-1ij019s"> <pre class="leafygreen-ui-12cejcz" tabindex="0"><code class="lg-highlight-hljs-dark json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> cursorHasMore<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-keyword">false</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> documents<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> type<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"MisplacedCollection"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> description<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"Unsharded collection found on shard different from database primary shard"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> details<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> namespace<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"test.authors"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> shard<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"shard02"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> localUUID<span class="lg-highlight-punctuation">:</span> new UUID(<span class="lg-highlight-string">"1ad56770-61e2-48e9-83c6-8ecefe73cfc4"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">]</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</span></td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/core/sharding-reshard-a-collection/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Reshard a Collection <a class="headerlink leafygreen-ui-1kepx47" href="#reshard-a-collection" 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="reshard-a-collection"> </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="#about-this-task" target="_self"> <span> About this Task </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#before-you-begin" target="_self"> <span> Before you Begin </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#steps" target="_self"> <span> Steps </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#start-the-resharding-operation" target="_self"> <span> Start the resharding operation. </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#monitor-the-resharding-operation" target="_self"> <span> Monitor the resharding operation. </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#finish-the-resharding-operation" target="_self"> <span> Finish the resharding operation. </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-1ggfb31" href="#block-writes-early-to-force-resharding-to-complete" target="_self"> <span> Block writes early to force resharding to complete </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-1ggfb31" href="#abort-resharding-operation" target="_self"> <span> Abort resharding operation </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#minimum-duration-of-a-resharding-operation" target="_self"> <span> Minimum Duration of a Resharding Operation </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#retryable-writes" target="_self"> <span> Retryable Writes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#error-case" target="_self"> <span> Error Case </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#duplicate-_id-values" target="_self"> <span> Duplicate <code class="css-1kekw28 e1wawog0"> _id </code> Values </span> </a> </li> </ul> </div> <div> <p> <em> New <!-- --> in version <!-- --> 5.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> The ideal shard key allows MongoDB to distribute documents evenly throughout the cluster while facilitating common query patterns. A suboptimal shard key can lead to performance or scaling issues due to uneven data distribution. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, you can change the shard key for a collection to change the distribution of your data across a cluster. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 7.2, you can reshard a collection on the same shard key, allowing you to redistribute data to include new shards or to different zones without changing your shard key. </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"> Before resharding your collection, read <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-troubleshooting-shard-keys/#std-label-shardkey-troubleshoot-shard-keys"> Troubleshoot Shard Keys </a> for information on common performance and scaling issues and advice on how to fix them. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-resharding-limitations"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> About this Task <a class="headerlink leafygreen-ui-1kepx47" href="#about-this-task" 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="about-this-task"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Only one collection can be resharded at a time. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.writeConcernMajorityJournalDefault"> <code class="leafygreen-ui-1l06pbn"> writeConcernMajorityJournalDefault </code> </a> must be <code class="leafygreen-ui-1l06pbn"> true </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To reshard a collection that has a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-unique/#std-label-index-type-unique"> uniqueness </a> constraint, the new shard key must satisfy the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-shard-key/#std-label-sharding-shard-key-unique"> unique index requirements </a> for any existing unique indexes. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The following commands and corresponding shell methods are not supported on the collection that is being resharded while the resharding operation is in progress: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/convertToCapped/#mongodb-dbcommand-dbcmd.convertToCapped"> <code class="leafygreen-ui-1l06pbn"> convertToCapped </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createIndexes/#mongodb-dbcommand-dbcmd.createIndexes"> <code class="leafygreen-ui-1l06pbn"> createIndexes </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex"> <code class="leafygreen-ui-1l06pbn"> createIndex() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/drop/#mongodb-dbcommand-dbcmd.drop"> <code class="leafygreen-ui-1l06pbn"> drop </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.drop/#mongodb-method-db.collection.drop"> <code class="leafygreen-ui-1l06pbn"> drop() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dropIndexes/#mongodb-dbcommand-dbcmd.dropIndexes"> <code class="leafygreen-ui-1l06pbn"> dropIndexes </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.dropIndex/#mongodb-method-db.collection.dropIndex"> <code class="leafygreen-ui-1l06pbn"> dropIndex() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/renameCollection/#mongodb-dbcommand-dbcmd.renameCollection"> <code class="leafygreen-ui-1l06pbn"> renameCollection </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.renameCollection/#mongodb-method-db.collection.renameCollection"> <code class="leafygreen-ui-1l06pbn"> renameCollection() </code> </a> </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The following commands and methods are not supported on the cluster while the resharding operation is in progress: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/addShard/#mongodb-dbcommand-dbcmd.addShard"> <code class="leafygreen-ui-1l06pbn"> addShard </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/removeShard/#mongodb-dbcommand-dbcmd.removeShard"> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <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> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dropDatabase/#mongodb-dbcommand-dbcmd.dropDatabase"> <code class="leafygreen-ui-1l06pbn"> dropDatabase </code> </a> </p> </li> </ul> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Using any of the preceding commands during a resharding operation causes the resharding operation to fail. </p> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the collection to be resharded uses <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/" target="_self"> <span> Atlas Search </span> </a> , the search index will become unavailable when the resharding operation completes. You need to manually rebuild the search index once the resharding operation completes. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can't reshard a sharded <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-manual-timeseries-collection"> time series collection <!-- --> . </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-reshard-requirements"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Before you Begin <a class="headerlink leafygreen-ui-1kepx47" href="#before-you-begin" 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="before-you-begin"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Before you reshard your collection, ensure that you meet the following requirements: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your application can tolerate a period of <strong> two seconds </strong> where the affected collection blocks writes. During the time period where writes are blocked, your application experiences an increase in latency. </p> <p class="leafygreen-ui-1kp3ins"> If your workload cannot tolerate this requirement, consider <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-refine-a-shard-key/#std-label-shard-key-refine"> refining your shard key </a> instead. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your database meets these resource requirements: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Ensure that the available storage space on each shard the collection will be distributed across is at least twice the size of the collection that you want to reshard and its total index size, divided by the number of shards. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"storage_req = ( ( collection_storage_size + index_size ) * 2 ) / shard_count"} </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">storage_req = ( ( collection_storage_size + index_size ) * 2 ) / shard_count</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For example, consider a collection that contains 2 TB of data and has a 400 GB index distributed across four shards. To perform a resharding operation on this collection, each shard would require 1.2 TB of available storage. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"1.2 TB storage = ( ( 2 TB collection + 0.4 TB index ) * 2 ) / 4 shards"} </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">1.2 TB storage = ( ( 2 TB collection + 0.4 TB index ) * 2 ) / 4 shards</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To meet storage requirements, you may need to upgrade to the next tier of storage during the resharding operation. You can scale down once the operation completes. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Ensure that your I/O capacity is below 50%. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Ensure that your CPU load is below 80%. </p> </li> </ul> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> These requirements are not enforced by the database. A failure to allocate enough resources can result in: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the database running out of space and shutting down </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> decreased performance </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the operation taking longer than expected </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If your application has time periods with less traffic, perform this operation on the collection during that time if possible. </p> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You must rewrite your application's queries to use <strong> both </strong> the current shard key and the new shard key. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If your application can tolerate downtime, you can perform these steps to avoid rewriting your application's queries to use both the current and new shard keys: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Stop your application. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Rewrite your application to use the <strong> new </strong> shard key. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Wait until resharding completes. To monitor the resharding process, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/currentOp/#mongodb-pipeline-pipe.-currentOp"> <code class="leafygreen-ui-1l06pbn"> $currentOp </code> </a> pipeline stage. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Deploy your rewritten application. </p> </li> </ol> </div> </div> <p class="leafygreen-ui-1kp3ins"> Before resharding completes, the following queries return an error if the query filter does not include either the current shard key or a unique field (like <code class="leafygreen-ui-1l06pbn"> _id </code> ): </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.deleteOne/#mongodb-method-db.collection.deleteOne"> <code class="leafygreen-ui-1l06pbn"> deleteOne() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findAndModify/#mongodb-method-db.collection.findAndModify"> <code class="leafygreen-ui-1l06pbn"> findAndModify() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findOneAndDelete/#mongodb-method-db.collection.findOneAndDelete"> <code class="leafygreen-ui-1l06pbn"> findOneAndDelete() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findOneAndReplace/#mongodb-method-db.collection.findOneAndReplace"> <code class="leafygreen-ui-1l06pbn"> findOneAndReplace() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findOneAndUpdate/#mongodb-method-db.collection.findOneAndUpdate"> <code class="leafygreen-ui-1l06pbn"> findOneAndUpdate() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.replaceOne/#mongodb-method-db.collection.replaceOne"> <code class="leafygreen-ui-1l06pbn"> replaceOne() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#mongodb-method-db.collection.updateOne"> <code class="leafygreen-ui-1l06pbn"> updateOne() </code> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For optimal performance, we recommend that you also rewrite other queries to include the new shard key. </p> <p class="leafygreen-ui-1kp3ins"> Once the resharding operation completes, you can remove the old shard key from the queries. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> No index builds are in progress. Use <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> to check for any running index builds: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":" db.adminCommand(\n {\n currentOp: true,\n $or: [\n { op: \"command\", \"command.createIndexes\": { $exists: true } },\n { op: \"none\", \"msg\" : /^Index Build/ }\n ]\n }\n)"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"> db.adminCommand(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> currentOp: true,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> $or: [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { op: "command", "command.createIndexes": { $exists: true } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { op: "none", "msg" : /^Index Build/ }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the result document, if the <code class="leafygreen-ui-1l06pbn"> inprog </code> field value is an empty array, there are no index builds in progress: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n inprog: [],\n ok: 1,\n '$clusterTime': { ... },\n operationTime: &lt;timestamp&gt;\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">inprog</span>: <!-- -->[<!-- -->]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">ok</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$clusterTime'</span>: <!-- -->{ <!-- -->...<!-- --> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">operationTime</span>: &lt;<!-- -->timestamp<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Resharding <!-- --> is a write-intensive process which can generate increased rates of oplog. You may wish to: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> set a fixed oplog size to prevent unbounded oplog growth. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> increase the oplog size to minimize the chance that one or more secondary nodes becomes stale. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> See the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-oplog/#std-label-replica-set-oplog"> Replica Set Oplog </a> documentation for more details. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-resharding_process"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Steps <a class="headerlink leafygreen-ui-1kepx47" href="#steps" 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="steps"> </div> </a> </h2> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> We strongly recommend that you check the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-resharding-limitations" target="_self"> <span> About this Task </span> </a> and read the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-resharding_process" target="_self"> <span> Steps </span> </a> section in full before resharding your collection. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> In a collection resharding operation, a shard can be a: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> donor </strong> , which currently stores <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-chunk"> chunks </a> for the sharded collection. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> recipient </strong> , which stores new chunks for the sharded collection based on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key"> shard keys </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/zone-sharding/#std-label-zone-sharding"> zones <!-- --> . </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> A shard can be donor and a recipient at the same time. The set of donor shards is identical to the recipient shards, unless you use zones. </p> <p class="leafygreen-ui-1kp3ins"> The config server primary is always the resharding coordinator and starts each phase of the resharding operation. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Start the resharding operation.While connected to the mongos, issue a\nreshardCollection command that specifies the collection\nto be resharded and the new shard key:MongoDB sets the max number of seconds to block writes to two seconds\nand begins the resharding operation."},{"@type":"HowToStep","text":"Monitor the resharding operation.To monitor the resharding operation, you can use the\n$currentOp pipeline stage:To see updated values, you need to continuously run the\npreceeding pipeline.The $currentOp pipeline outputs:totalOperationTimeElapsedSecs: elapsed operation time in\nsecondsremainingOperationTimeEstimatedSecs: estimated time remaining in\nseconds for the current resharding operation. It is returned as -1 when a new resharding\noperation starts.Starting in:MongoDB 5.0, but before MongoDB 6.1,\nremainingOperationTimeEstimatedSecs is only available on a\nrecipient shard during a\nresharding operation.MongoDB 6.1, remainingOperationTimeEstimatedSecs is also available\non the coordinator during a resharding operation.The resharding operation performs these phases in order:The clone phase duplicates the current collection data.The catch-up phase applies any pending write operations to the\nresharded collection.remainingOperationTimeEstimatedSecs is set to a pessimistic time\nestimate:The catch-up phase time estimate is set to the clone phase time, which\nis a relatively long time.In practice, if there are only a few pending write operations, the\nactual catch-up phase time is relatively short."},{"@type":"HowToStep","text":"Finish the resharding operation.Throughout the resharding process, the estimated time to complete the\nresharding operation (remainingOperationTimeEstimatedSecs)\ndecreases. When the estimated time is below two seconds, MongoDB\nblocks writes and completes the resharding operation. Until the\nestimated time to complete the resharing operation is below two\nseconds, the resharding operation does not block writes by default.\nDuring the time period where writes are blocked your application\nexperiences an increase in latency.Once the resharding process has completed, the resharding command\nreturns ok: 1.To see whether the resharding operation completed successfully, check\nthe output of the sh.status() method:The sh.status() method output contains a subsection for the\ndatabases. If resharding has completed successfully, the output\nlists the new shard key for the collection:If the resharded collection uses Atlas Search, the search index will become unavailable when\nthe resharding operation completes. You need to manually rebuild\nthe search index once the resharding operation completes.Block writes early to force resharding to completeYou can manually force the resharding operation to complete by\nissuing the commitReshardCollection command. This is\nuseful if the current time estimate to complete the resharding\noperation is an acceptable duration for your collection to block\nwrites. The commitReshardCollection command blocks\nwrites for the duration of the critical section and forces the\nresharding operation to complete. The command has the following\nsyntax:Abort resharding operationYou can abort the resharding operation during any stage of the\nresharding operation, even after running the\ncommitReshardCollection, until shards have fully caught\nup.For example, if remainingOperationTimeEstimatedSecs does not\ndecrease, you can abort the resharding operation with the\nabortReshardCollection command:After canceling the operation, you can retry the resharding\noperation during a time window with lower write volume. If this is\nnot possible, add more shards\nbefore retrying."}],"name":"Steps","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Start the resharding operation. <a class="headerlink leafygreen-ui-1kepx47" href="#start-the-resharding-operation" 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="start-the-resharding-operation"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> While connected to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , issue a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/reshardCollection/#mongodb-dbcommand-dbcmd.reshardCollection"> <code class="leafygreen-ui-1l06pbn"> reshardCollection </code> </a> command that specifies the collection to be resharded and the new shard key: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand({\n reshardCollection: \"&lt;database&gt;.&lt;collection&gt;\",\n key: &lt;shardkey&gt;\n})","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">reshardCollection</span>: <span class="lg-highlight-string">"&lt;database&gt;.&lt;collection&gt;"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">key</span>: &lt;<!-- -->shardkey<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB sets the max number of seconds to block writes to two seconds and begins the resharding operation. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Monitor the resharding operation. <a class="headerlink leafygreen-ui-1kepx47" href="#monitor-the-resharding-operation" 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="monitor-the-resharding-operation"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To monitor the resharding operation, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/currentOp/#mongodb-pipeline-pipe.-currentOp"> <code class="leafygreen-ui-1l06pbn"> $currentOp </code> </a> pipeline stage: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.getSiblingDB(\"admin\").aggregate([\n { $currentOp: { allUsers: true, localOps: false } },\n {\n $match: {\n type: \"op\",\n \"originatingCommand.reshardCollection\": \"&lt;database&gt;.&lt;collection&gt;\"\n }\n }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<span class="lg-highlight-string">"admin"</span>).<span class="lg-highlight-title lg-highlight-function">aggregate</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$currentOp</span>: <!-- -->{ <span class="lg-highlight-attr">allUsers</span>: <span class="lg-highlight-literal">true</span>, <span class="lg-highlight-attr">localOps</span>: <span class="lg-highlight-literal">false</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$match</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"op"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"originatingCommand.reshardCollection"</span>: <span class="lg-highlight-string">"&lt;database&gt;.&lt;collection&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To see updated values, you need to continuously run the preceeding pipeline. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/currentOp/#mongodb-pipeline-pipe.-currentOp"> <code class="leafygreen-ui-1l06pbn"> $currentOp </code> </a> pipeline outputs: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> totalOperationTimeElapsedSecs </code> : elapsed operation time in seconds </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> remainingOperationTimeEstimatedSecs </code> : estimated time remaining in seconds for the current <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-sharding-resharding" target="_self"> <span> resharding operation </span> </a> . It is returned as <code class="leafygreen-ui-1l06pbn"> -1 </code> when a new resharding operation starts. </p> <p class="leafygreen-ui-1kp3ins"> Starting in: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0, but before MongoDB 6.1, <code class="leafygreen-ui-1l06pbn"> remainingOperationTimeEstimatedSecs </code> is only available on a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.reshardCollection/#std-label-resharding-process-details"> recipient shard </a> during a resharding operation. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MongoDB 6.1, <code class="leafygreen-ui-1l06pbn"> remainingOperationTimeEstimatedSecs </code> is also available on the coordinator during a resharding operation. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The resharding operation performs these phases in order: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The clone phase duplicates the current collection data. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The catch-up phase applies any pending write operations to the resharded collection. </p> </li> </ol> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> remainingOperationTimeEstimatedSecs </code> is set to a pessimistic time estimate: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The catch-up phase time estimate is set to the clone phase time, which is a relatively long time. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In practice, if there are only a few pending write operations, the actual catch-up phase time is relatively short. </p> </li> </ul> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n {\n shard: '&lt;shard&gt;',\n type: 'op',\n desc: 'ReshardingRecipientService | ReshardingDonorService | ReshardingCoordinatorService &lt;reshardinguuid&gt;',\n op: 'command',\n ns: '&lt;database&gt;.&lt;collection&gt;',\n originatingCommand: {\n reshardCollection: '&lt;database&gt;.&lt;collection&gt;',\n key: &lt;shardkey&gt;,\n unique: &lt;boolean&gt;,\n collation: { locale: 'simple' }\n },\n totalOperationTimeElapsedSecs: &lt;number&gt;,\n remainingOperationTimeEstimatedSecs: &lt;number&gt;,\n ...\n },\n ...\n]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">shard</span>: <span class="lg-highlight-string">'&lt;shard&gt;'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">'op'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">desc</span>: <span class="lg-highlight-string">'ReshardingRecipientService | ReshardingDonorService | ReshardingCoordinatorService &lt;reshardingUUID&gt;'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">op</span>: <span class="lg-highlight-string">'command'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">ns</span>: <span class="lg-highlight-string">'&lt;database&gt;.&lt;collection&gt;'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">originatingCommand</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">reshardCollection</span>: <span class="lg-highlight-string">'&lt;database&gt;.&lt;collection&gt;'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">key</span>: &lt;<!-- -->shardkey<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">unique</span>: &lt;<!-- -->boolean<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">'simple'</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">totalOperationTimeElapsedSecs</span>: &lt;<!-- -->number<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">remainingOperationTimeEstimatedSecs</span>: &lt;<!-- -->number<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Finish the resharding operation. <a class="headerlink leafygreen-ui-1kepx47" href="#finish-the-resharding-operation" 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="finish-the-resharding-operation"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Throughout the resharding process, the estimated time to complete the resharding operation ( <code class="leafygreen-ui-1l06pbn"> remainingOperationTimeEstimatedSecs </code> ) decreases. When the estimated time is below <strong> two seconds </strong> , MongoDB blocks writes and completes the resharding operation. Until the estimated time to complete the resharing operation is below two seconds, the resharding operation does not block writes by default. During the time period where writes are blocked your application experiences an increase in latency. </p> <p class="leafygreen-ui-1kp3ins"> Once the resharding process has completed, the resharding command returns <code class="leafygreen-ui-1l06pbn"> ok: 1 </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n ok: 1,\n '$clusterTime': {\n clusterTime: &lt;timestamp&gt;,\n signature: {\n hash: Binary(Buffer.from(\"0000000000000000000000000000000000000000\", \"hex\"), 0),\n keyId: &lt;number&gt;\n }\n },\n operationTime: &lt;timestamp&gt;\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">ok</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'$clusterTime'</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">clusterTime</span>: &lt;<!-- -->timestamp<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">signature</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">hash</span>: <span class="lg-highlight-title lg-highlight-class">Binary</span>(<span class="lg-highlight-title lg-highlight-class">Buffer</span>.<span class="lg-highlight-title lg-highlight-function">from</span>(<span class="lg-highlight-string">"0000000000000000000000000000000000000000"</span>, <span class="lg-highlight-string">"hex"</span>)<!-- -->, <span class="lg-highlight-number">0</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">keyId</span>: &lt;<!-- -->number<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">operationTime</span>: &lt;<!-- -->timestamp<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To see whether the resharding operation completed successfully, check the output of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.status/#mongodb-method-sh.status"> <code class="leafygreen-ui-1l06pbn"> sh.status() </code> </a> method: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.status()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">status</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 <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.status/#mongodb-method-sh.status"> <code class="leafygreen-ui-1l06pbn"> sh.status() </code> </a> method output contains a subsection for the <code class="leafygreen-ui-1l06pbn"> databases </code> . If resharding has completed successfully, the output lists the new shard key for the collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"databases\n[\n {\n database: {\n _id: '&lt;database&gt;',\n primary: '&lt;shard&gt;',\n version: {\n uuid: &lt;uuid&gt;,\n timestamp: &lt;timestamp&gt;,\n lastMod: &lt;number&gt;\n }\n },\n collections: {\n '&lt;database&gt;.&lt;collection&gt;': {\n shardKey: &lt;shardkey&gt;,\n unique: &lt;boolean&gt;,\n balancing: &lt;boolean&gt;,\n chunks: [],\n tags: []\n }\n }\n }\n ...\n]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">databases</td></tr><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">database</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">'&lt;database&gt;'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">primary</span>: <span class="lg-highlight-string">'&lt;shard&gt;'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">version</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">uuid</span>: &lt;<!-- -->uuid<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: &lt;<!-- -->timestamp<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">lastMod</span>: &lt;<!-- -->number<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collections</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'&lt;database&gt;.&lt;collection&gt;'</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">shardKey</span>: &lt;<!-- -->shardkey<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">unique</span>: &lt;<!-- -->boolean<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">balancing</span>: &lt;<!-- -->boolean<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">chunks</span>: <!-- -->[<!-- -->]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->[<!-- -->]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If the resharded collection uses <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/" target="_self"> <span> Atlas Search </span> </a> , the search index will become unavailable when the resharding operation completes. You need to manually rebuild the search index once the resharding operation completes. </p> </div> </div> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Block writes early to force resharding to complete <a class="headerlink leafygreen-ui-1kepx47" href="#block-writes-early-to-force-resharding-to-complete" 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="block-writes-early-to-force-resharding-to-complete"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> You can manually force the resharding operation to complete by issuing the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/commitReshardCollection/#mongodb-dbcommand-dbcmd.commitReshardCollection"> <code class="leafygreen-ui-1l06pbn"> commitReshardCollection </code> </a> command. This is useful if the current time estimate to complete the resharding operation is an acceptable duration for your collection to block writes. The <code class="leafygreen-ui-1l06pbn"> commitReshardCollection </code> command blocks writes for the duration of the critical section and forces the resharding operation to complete. The command has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand({\n commitReshardCollection: \"&lt;database&gt;.&lt;collection&gt;\"\n})","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">commitReshardCollection</span>: <span class="lg-highlight-string">"&lt;database&gt;.&lt;collection&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Abort resharding operation <a class="headerlink leafygreen-ui-1kepx47" href="#abort-resharding-operation" 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="abort-resharding-operation"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> You can abort the resharding operation during any stage of the resharding operation, even after running the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/commitReshardCollection/#mongodb-dbcommand-dbcmd.commitReshardCollection"> <code class="leafygreen-ui-1l06pbn"> commitReshardCollection </code> </a> , until shards have fully caught up. </p> <p class="leafygreen-ui-1kp3ins"> For example, if <code class="leafygreen-ui-1l06pbn"> remainingOperationTimeEstimatedSecs </code> does not decrease, you can abort the resharding operation with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/abortReshardCollection/#mongodb-dbcommand-dbcmd.abortReshardCollection"> <code class="leafygreen-ui-1l06pbn"> abortReshardCollection </code> </a> command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand({\n abortReshardCollection: \"&lt;database&gt;.&lt;collection&gt;\"\n})","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">abortReshardCollection</span>: <span class="lg-highlight-string">"&lt;database&gt;.&lt;collection&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> After canceling the operation, you can retry the resharding operation during a time window with lower write volume. If this is not possible, <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/add-shards-to-shard-cluster/#std-label-sharding-procedure-add-shard"> add more shards </a> before retrying. </p> </section> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Minimum Duration of a Resharding Operation <a class="headerlink leafygreen-ui-1kepx47" href="#minimum-duration-of-a-resharding-operation" 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="minimum-duration-of-a-resharding-operation"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The minimum duration of a resharding operation is always 5 minutes. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Retryable Writes <a class="headerlink leafygreen-ui-1kepx47" href="#retryable-writes" 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="retryable-writes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/retryable-writes/#std-label-retryable-writes"> Retryable writes </a> initiated before or during resharding can be retried during and after the collection has been resharded for up to 5 minutes. After 5 minutes you may be unable to find the definitive result of the write and subsequent attempts to retry the write fail with an <code class="leafygreen-ui-1l06pbn"> IncompleteTransactionHistory </code> error. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Error Case <a class="headerlink leafygreen-ui-1kepx47" href="#error-case" 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="error-case"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Duplicate <code class="leafygreen-ui-1l06pbn"> _id </code> Values <a class="headerlink leafygreen-ui-1kepx47" href="#duplicate-_id-values" 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="duplicate-_id-values"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The resharding operation fails if <code class="leafygreen-ui-1l06pbn"> _id </code> values are not globally unique to avoid corrupting collection data. Duplicate <code class="leafygreen-ui-1l06pbn"> _id </code> values can also prevent successful chunk migration. If you have documents with duplicate <code class="leafygreen-ui-1l06pbn"> _id </code> values, copy the data from each into a new document, and then delete the duplicate documents. </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/error-codes/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Error Codes <a class="headerlink leafygreen-ui-1kepx47" href="#error-codes" 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="error-codes"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> MongoDB will return one of the following codes when an error occurs. Use this guide to interpret logs and when troubleshooting issues with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-error-codes"> </span> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:12%"/> <col style="width:88%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Code </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Cause </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 1 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-1" 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-error-1"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InternalError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 2 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-2" 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-error-2"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> BadValue </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 4 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-4" 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-error-4"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NoSuchKey </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 5 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-5" 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-error-5"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> GraphContainsCycle </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 6 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-6" 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-error-6"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> HostUnreachable </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 7 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-7" 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-error-7"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> HostNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 8 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-8" 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-error-8"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UnknownError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 9 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-9" 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-error-9"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FailedToParse </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 10 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-10" 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-error-10"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotMutateObject </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 11 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-11" 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-error-11"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UserNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 12 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-12" 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-error-12"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UnsupportedFormat </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 13 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-13" 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-error-13"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Unauthorized </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 14 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-14" 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-error-14"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TypeMismatch </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 15 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-15" 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-error-15"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Overflow </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 16 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-16" 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-error-16"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidLength </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 17 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-17" 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-error-17"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ProtocolError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 18 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-18" 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-error-18"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> AuthenticationFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 19 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-19" 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-error-19"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotReuseObject </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 20 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-20" 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-error-20"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IllegalOperation </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 21 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-21" 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-error-21"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> EmptyArrayOperation </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 22 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-22" 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-error-22"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidBSON </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 23 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-23" 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-error-23"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> AlreadyInitialized </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 24 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-24" 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-error-24"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> LockTimeout </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 25 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-25" 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-error-25"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RemoteValidationError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 26 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-26" 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-error-26"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NamespaceNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 27 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-27" 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-error-27"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IndexNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 28 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-28" 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-error-28"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> PathNotViable </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 29 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-29" 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-error-29"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NonExistentPath </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 30 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-30" 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-error-30"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidPath </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 31 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-31" 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-error-31"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RoleNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 32 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-32" 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-error-32"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RolesNotRelated </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 33 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-33" 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-error-33"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> PrivilegeNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 34 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-34" 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-error-34"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotBackfillArray </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 35 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-35" 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-error-35"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UserModificationFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 36 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-36" 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-error-36"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RemoteChangeDetected </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 37 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-37" 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-error-37"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FileRenameFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 38 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-38" 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-error-38"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FileNotOpen </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 39 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-39" 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-error-39"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FileStreamFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 40 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-40" 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-error-40"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ConflictingUpdateOperators </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 41 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-41" 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-error-41"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FileAlreadyOpen </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 42 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-42" 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-error-42"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> LogWriteFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 43 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-43" 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-error-43"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CursorNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 45 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-45" 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-error-45"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UserDataInconsistent </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 46 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-46" 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-error-46"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> LockBusy </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 47 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-47" 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-error-47"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NoMatchingDocument </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 48 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-48" 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-error-48"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NamespaceExists </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 49 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-49" 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-error-49"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidRoleModification </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 50 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-50" 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-error-50"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MaxTimeMSExpired </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 51 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-51" 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-error-51"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ManualInterventionRequired </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 52 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-52" 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-error-52"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DollarPrefixedFieldName </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 53 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-53" 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-error-53"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidIdField </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 54 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-54" 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-error-54"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NotSingleValueField </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 55 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-55" 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-error-55"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidDBRef </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 56 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-56" 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-error-56"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> EmptyFieldName </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 57 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-57" 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-error-57"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DottedFieldName </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 58 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-58" 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-error-58"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RoleModificationFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 59 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-59" 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-error-59"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CommandNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 61 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-61" 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-error-61"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ShardKeyNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 62 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-62" 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-error-62"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OplogOperationUnsupported </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 63 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-63" 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-error-63"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> StaleShardVersion </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 64 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-64" 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-error-64"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> WriteConcernFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 65 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-65" 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-error-65"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MultipleErrorsOccurred </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 66 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-66" 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-error-66"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ImmutableField </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 67 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-67" 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-error-67"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotCreateIndex </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 68 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-68" 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-error-68"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IndexAlreadyExists </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 69 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-69" 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-error-69"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> AuthSchemaIncompatible </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 70 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-70" 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-error-70"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ShardNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 71 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-71" 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-error-71"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ReplicaSetNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 72 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-72" 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-error-72"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidOptions </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 73 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-73" 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-error-73"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidNamespace </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 74 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-74" 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-error-74"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NodeNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 75 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-75" 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-error-75"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> WriteConcernLegacyOK </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 76 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-76" 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-error-76"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NoReplicationEnabled </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 77 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-77" 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-error-77"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OperationIncomplete </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 78 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-78" 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-error-78"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CommandResultSchemaViolation </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 79 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-79" 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-error-79"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UnknownReplWriteConcern </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 80 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-80" 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-error-80"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RoleDataInconsistent </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 81 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-81" 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-error-81"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NoMatchParseContext </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 82 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-82" 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-error-82"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NoProgressMade </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 83 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-83" 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-error-83"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RemoteResultsUnavailable </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 85 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-85" 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-error-85"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IndexOptionsConflict </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 86 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-86" 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-error-86"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IndexKeySpecsConflict </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 87 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-87" 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-error-87"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotSplit </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 89 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-89" 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-error-89"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NetworkTimeout </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 90 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-90" 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-error-90"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CallbackCanceled </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 91 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-91" 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-error-91"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ShutdownInProgress </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 92 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-92" 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-error-92"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> SecondaryAheadOfPrimary </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 93 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-93" 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-error-93"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidReplicaSetConfig </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 94 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-94" 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-error-94"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NotYetInitialized </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 95 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-95" 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-error-95"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NotSecondary </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 96 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-96" 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-error-96"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OperationFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 97 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-97" 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-error-97"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NoProjectionFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 98 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-98" 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-error-98"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DBPathInUse </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 100 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-100" 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-error-100"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UnsatisfiableWriteConcern </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 101 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-101" 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-error-101"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OutdatedClient </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 102 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-102" 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-error-102"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IncompatibleAuditMetadata </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 103 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-103" 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-error-103"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NewReplicaSetConfigurationIncompatible </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 104 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-104" 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-error-104"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NodeNotElectable </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 105 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-105" 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-error-105"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IncompatibleShardingMetadata </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 106 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-106" 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-error-106"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DistributedClockSkewed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 107 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-107" 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-error-107"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> LockFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 108 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-108" 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-error-108"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InconsistentReplicaSetNames </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 109 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-109" 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-error-109"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ConfigurationInProgress </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 110 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-110" 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-error-110"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotInitializeNodeWithData </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 111 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-111" 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-error-111"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NotExactValueField </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 112 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-112" 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-error-112"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> WriteConflict </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 113 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-113" 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-error-113"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InitialSyncFailure </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 114 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-114" 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-error-114"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InitialSyncOplogSourceMissing </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 115 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-115" 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-error-115"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CommandNotSupported </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 116 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-116" 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-error-116"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DocTooLargeForCapped </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 117 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-117" 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-error-117"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ConflictingOperationInProgress </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 118 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-118" 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-error-118"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NamespaceNotSharded </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 119 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-119" 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-error-119"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidSyncSource </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 120 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-120" 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-error-120"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OplogStartMissing </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 121 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-121" 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-error-121"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DocumentValidationFailure (only for the document validator on collections) </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 123 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-123" 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-error-123"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NotAReplicaSet </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 124 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-124" 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-error-124"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IncompatibleElectionProtocol </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 125 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-125" 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-error-125"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CommandFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 126 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-126" 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-error-126"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RPCProtocolNegotiationFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 127 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-127" 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-error-127"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UnrecoverableRollbackError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 128 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-128" 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-error-128"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> LockNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 129 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-129" 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-error-129"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> LockStateChangeFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 130 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-130" 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-error-130"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> SymbolNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 133 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-133" 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-error-133"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FailedToSatisfyReadPreference </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 134 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-134" 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-error-134"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ReadConcernMajorityNotAvailableYet </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 135 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-135" 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-error-135"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> StaleTerm </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 136 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-136" 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-error-136"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CappedPositionLost </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 137 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-137" 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-error-137"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IncompatibleShardingConfigVersion </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 138 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-138" 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-error-138"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RemoteOplogStale </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 139 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-139" 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-error-139"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> JSInterpreterFailure </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 140 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-140" 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-error-140"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidSSLConfiguration </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 141 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-141" 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-error-141"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> SSLHandshakeFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 142 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-142" 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-error-142"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> JSUncatchableError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 143 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-143" 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-error-143"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CursorInUse </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 144 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-144" 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-error-144"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IncompatibleCatalogManager </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 145 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-145" 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-error-145"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> PooledConnectionsDropped </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 146 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-146" 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-error-146"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ExceededMemoryLimit </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 147 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-147" 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-error-147"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ZLibError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 148 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-148" 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-error-148"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ReadConcernMajorityNotEnabled </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 149 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-149" 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-error-149"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NoConfigPrimary </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 150 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-150" 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-error-150"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> StaleEpoch </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 151 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-151" 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-error-151"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OperationCannotBeBatched </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 152 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-152" 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-error-152"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OplogOutOfOrder </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 153 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-153" 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-error-153"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ChunkTooBig </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 154 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-154" 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-error-154"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InconsistentShardIdentity </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 155 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-155" 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-error-155"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotApplyOplogWhilePrimary </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 157 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-157" 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-error-157"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CanRepairToDowngrade </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 158 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-158" 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-error-158"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MustUpgrade </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 159 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-159" 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-error-159"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DurationOverflow </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 160 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-160" 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-error-160"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MaxStalenessOutOfRange </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 161 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-161" 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-error-161"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IncompatibleCollationVersion </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 162 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-162" 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-error-162"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CollectionIsEmpty </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 163 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-163" 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-error-163"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ZoneStillInUse </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 164 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-164" 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-error-164"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InitialSyncActive </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 165 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-165" 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-error-165"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ViewDepthLimitExceeded </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 166 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-166" 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-error-166"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CommandNotSupportedOnView </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 167 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-167" 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-error-167"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OptionNotSupportedOnView </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 168 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-168" 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-error-168"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidPipelineOperator </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 169 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-169" 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-error-169"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CommandOnShardedViewNotSupportedOnMongod </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 170 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-170" 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-error-170"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TooManyMatchingDocuments </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 171 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-171" 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-error-171"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotIndexParallelArrays </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 172 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-172" 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-error-172"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TransportSessionClosed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 173 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-173" 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-error-173"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TransportSessionNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 174 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-174" 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-error-174"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TransportSessionUnknown </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 175 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-175" 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-error-175"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> QueryPlanKilled </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 176 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-176" 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-error-176"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FileOpenFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 177 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-177" 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-error-177"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ZoneNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 178 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-178" 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-error-178"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RangeOverlapConflict </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 179 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-179" 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-error-179"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> WindowsPdhError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 180 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-180" 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-error-180"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> BadPerfCounterPath </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 181 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-181" 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-error-181"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> AmbiguousIndexKeyPattern </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 182 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-182" 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-error-182"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidViewDefinition </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 183 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-183" 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-error-183"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ClientMetadataMissingField </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 184 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-184" 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-error-184"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ClientMetadataAppNameTooLarge </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 185 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-185" 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-error-185"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ClientMetadataDocumentTooLarge </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 186 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-186" 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-error-186"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ClientMetadataCannotBeMutated </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 187 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-187" 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-error-187"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> LinearizableReadConcernError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 188 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-188" 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-error-188"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IncompatibleServerVersion </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 189 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-189" 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-error-189"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> PrimarySteppedDown </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 190 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-190" 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-error-190"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MasterSlaveConnectionFailure </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 192 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-192" 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-error-192"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FailPointEnabled </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 193 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-193" 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-error-193"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NoShardingEnabled </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 194 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-194" 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-error-194"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> BalancerInterrupted </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 195 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-195" 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-error-195"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ViewPipelineMaxSizeExceeded </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 197 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-197" 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-error-197"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidIndexSpecificationOption </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 199 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-199" 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-error-199"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ReplicaSetMonitorRemoved </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 200 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-200" 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-error-200"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ChunkRangeCleanupPending </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 201 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-201" 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-error-201"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotBuildIndexKeys </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 202 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-202" 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-error-202"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NetworkInterfaceExceededTimeLimit </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 203 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-203" 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-error-203"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ShardingStateNotInitialized </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 204 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-204" 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-error-204"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TimeProofMismatch </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 205 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-205" 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-error-205"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ClusterTimeFailsRateLimiter </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 206 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-206" 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-error-206"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NoSuchSession </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 207 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-207" 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-error-207"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidUUID </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 208 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-208" 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-error-208"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TooManyLocks </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 209 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-209" 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-error-209"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> StaleClusterTime </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 210 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-210" 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-error-210"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotVerifyAndSignLogicalTime </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 211 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-211" 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-error-211"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> KeyNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 212 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-212" 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-error-212"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IncompatibleRollbackAlgorithm </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 213 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-213" 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-error-213"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DuplicateSession </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 214 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-214" 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-error-214"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> AuthenticationRestrictionUnmet </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 215 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-215" 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-error-215"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DatabaseDropPending </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 216 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-216" 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-error-216"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ElectionInProgress </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 217 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-217" 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-error-217"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IncompleteTransactionHistory </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 218 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-218" 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-error-218"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UpdateOperationFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 219 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-219" 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-error-219"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FTDCPathNotSet </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 220 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-220" 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-error-220"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FTDCPathAlreadySet </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 221 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-221" 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-error-221"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IndexModified </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 222 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-222" 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-error-222"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CloseChangeStream </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 223 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-223" 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-error-223"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IllegalOpMsgFlag </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 224 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-224" 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-error-224"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> QueryFeatureNotAllowed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 225 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-225" 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-error-225"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TransactionTooOld </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 226 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-226" 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-error-226"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> AtomicityFailure </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 227 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-227" 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-error-227"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotImplicitlyCreateCollection </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 228 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-228" 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-error-228"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> SessionTransferIncomplete </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 229 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-229" 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-error-229"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MustDowngrade </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 230 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-230" 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-error-230"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DNSHostNotFound </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 231 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-231" 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-error-231"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DNSProtocolError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 232 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-232" 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-error-232"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MaxSubPipelineDepthExceeded </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 233 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-233" 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-error-233"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TooManyDocumentSequences </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 234 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-234" 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-error-234"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RetryChangeStream </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 235 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-235" 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-error-235"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InternalErrorNotSupported </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 236 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-236" 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-error-236"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ForTestingErrorExtraInfo </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 237 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-237" 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-error-237"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CursorKilled </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 238 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-238" 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-error-238"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NotImplemented </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 239 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-239" 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-error-239"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> SnapshotTooOld </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 240 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-240" 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-error-240"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DNSRecordTypeMismatch </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 241 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-241" 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-error-241"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ConversionFailure </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 242 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-242" 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-error-242"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotCreateCollection </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 243 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-243" 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-error-243"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IncompatibleWithUpgradedServer </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 245 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-245" 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-error-245"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> BrokenPromise </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 246 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-246" 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-error-246"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> SnapshotUnavailable </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 247 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-247" 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-error-247"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ProducerConsumerQueueBatchTooLarge </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 248 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-248" 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-error-248"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ProducerConsumerQueueEndClosed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 249 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-249" 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-error-249"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> StaleDbVersion </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 250 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-250" 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-error-250"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> StaleChunkHistory </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 251 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-251" 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-error-251"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NoSuchTransaction </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 252 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-252" 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-error-252"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ReentrancyNotAllowed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 253 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-253" 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-error-253"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FreeMonHttpInFlight </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 254 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-254" 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-error-254"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FreeMonHttpTemporaryFailure </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 255 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-255" 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-error-255"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FreeMonHttpPermanentFailure </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 256 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-256" 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-error-256"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TransactionCommitted </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 257 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-257" 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-error-257"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TransactionTooLarge </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 258 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-258" 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-error-258"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UnknownFeatureCompatibilityVersion </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 259 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-259" 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-error-259"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> KeyedExecutorRetry </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 260 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-260" 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-error-260"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidResumeToken </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 261 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-261" 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-error-261"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TooManyLogicalSessions </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 262 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-262" 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-error-262"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ExceededTimeLimit </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 263 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-263" 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-error-263"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OperationNotSupportedInTransaction </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 264 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-264" 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-error-264"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TooManyFilesOpen </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 265 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-265" 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-error-265"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OrphanedRangeCleanUpFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 266 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-266" 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-error-266"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FailPointSetFailed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 267 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-267" 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-error-267"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> PreparedTransactionInProgress </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 268 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-268" 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-error-268"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotBackup </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 269 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-269" 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-error-269"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DataModifiedByRepair </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 270 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-270" 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-error-270"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RepairedReplicaSetNode </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 271 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-271" 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-error-271"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> JSInterpreterFailureWithStack </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 272 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-272" 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-error-272"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MigrationConflict </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 273 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-273" 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-error-273"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ProducerConsumerQueueProducerQueueDepthExceeded </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 274 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-274" 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-error-274"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ProducerConsumerQueueConsumed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 275 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-275" 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-error-275"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ExchangePassthrough </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 276 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-276" 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-error-276"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IndexBuildAborted </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 277 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-277" 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-error-277"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> AlarmAlreadyFulfilled </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 278 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-278" 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-error-278"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UnsatisfiableCommitQuorum </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 279 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-279" 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-error-279"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ClientDisconnect </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 280 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-280" 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-error-280"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ChangeStreamFatalError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 281 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-281" 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-error-281"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TransactionCoordinatorSteppingDown </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 282 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-282" 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-error-282"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TransactionCoordinatorReachedAbortDecision </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 283 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-283" 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-error-283"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> WouldChangeOwningShard </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 284 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-284" 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-error-284"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ForTestingErrorExtraInfoWithExtraInfoInNamespace </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 285 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-285" 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-error-285"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> IndexBuildAlreadyInProgress </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 286 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-286" 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-error-286"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ChangeStreamHistoryLost </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 287 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-287" 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-error-287"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TransactionCoordinatorDeadlineTaskCanceled </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 288 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-288" 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-error-288"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ChecksumMismatch </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 289 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-289" 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-error-289"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> WaitForMajorityServiceEarlierOpTimeAvailable </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 290 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-290" 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-error-290"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TransactionExceededLifetimeLimitSeconds </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 291 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-291" 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-error-291"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NoQueryExecutionPlans </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 292 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-292" 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-error-292"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> QueryExceededMemoryLimitNoDiskUseAllowed </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 293 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-293" 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-error-293"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidSeedList </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 294 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-294" 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-error-294"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidTopologyType </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 295 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-295" 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-error-295"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidHeartBeatFrequency </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 296 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-296" 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-error-296"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TopologySetNameRequired </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 297 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-297" 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-error-297"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> HierarchicalAcquisitionLevelViolation </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 298 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-298" 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-error-298"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InvalidServerType </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 299 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-299" 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-error-299"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OCSPCertificateStatusRevoked </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 300 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-300" 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-error-300"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RangeDeletionAbandonedBecauseCollectionWithUUIDDoesNotExist </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 301 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-301" 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-error-301"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DataCorruptionDetected </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 302 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-302" 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-error-302"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OCSPCertificateStatusUnknown </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 303 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-303" 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-error-303"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> SplitHorizonChange </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 304 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-304" 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-error-304"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ShardInvalidatedForTargeting </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 307 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-307" 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-error-307"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> RangeDeletionAbandonedBecauseTaskDocumentDoesNotExist </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 308 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-308" 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-error-308"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CurrentConfigNotCommittedYet </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 309 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-309" 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-error-309"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ExhaustCommandFinished </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 310 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-310" 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-error-310"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> PeriodicJobIsStopped </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 311 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-311" 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-error-311"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TransactionCoordinatorCanceled </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 312 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-312" 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-error-312"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OperationIsKilledAndDelisted </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 313 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-313" 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-error-313"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ResumableRangeDeleterDisabled </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 314 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-314" 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-error-314"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ObjectIsBusy </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 315 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-315" 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-error-315"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TooStaleToSyncFromSource </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 316 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-316" 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-error-316"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> QueryTrialRunCompleted </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 317 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-317" 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-error-317"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ConnectionPoolExpired </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 318 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-318" 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-error-318"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ForTestingOptionalErrorExtraInfo </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 319 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-319" 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-error-319"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MovePrimaryInProgress </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 320 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-320" 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-error-320"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TenantMigrationConflict </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 321 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-321" 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-error-321"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TenantMigrationCommitted </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 322 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-322" 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-error-322"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> APIVersionError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 323 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-323" 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-error-323"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> APIStrictError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 324 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-324" 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-error-324"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> APIDeprecationError </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 325 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-325" 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-error-325"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TenantMigrationAborted </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 326 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-326" 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-error-326"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OplogQueryMinTsMissing </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 327 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-327" 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-error-327"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NoSuchTenantMigration </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 328 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-328" 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-error-328"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TenantMigrationAccessBlockerShuttingDown </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 329 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-329" 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-error-329"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TenantMigrationInProgress </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 330 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-330" 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-error-330"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> SkipCommandExecution </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 331 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-331" 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-error-331"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> FailedToRunWithReplyBuilder </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 332 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-332" 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-error-332"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotDowngrade </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 333 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-333" 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-error-333"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ServiceExecutorInShutdown </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 334 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-334" 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-error-334"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MechanismUnavailable </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 335 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-335" 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-error-335"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> TenantMigrationForgotten </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 9001 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-9001" 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-error-9001"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> SocketException </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 10003 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-10003" 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-error-10003"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> CannotGrowDocumentInCappedNamespace </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 10107 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-10107" 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-error-10107"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NotWritablePrimary </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 10334 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-10334" 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-error-10334"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> BSONObjectTooLarge </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 11000 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-11000" 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-error-11000"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DuplicateKey </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 11600 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-11600" 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-error-11600"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InterruptedAtShutdown </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 11601 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-11601" 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-error-11601"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Interrupted </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 11602 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-11602" 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-error-11602"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> InterruptedDueToReplStateChange </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 12586 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-12586" 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-error-12586"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> BackgroundOperationInProgressForDatabase </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 12587 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-12587" 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-error-12587"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> BackgroundOperationInProgressForNamespace </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 13113 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-13113" 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-error-13113"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> MergeStageNoMatchingDocument </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 13297 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-13297" 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-error-13297"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> DatabaseDifferCase </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 13388 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-13388" 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-error-13388"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> StaleConfig </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 13435 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-13435" 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-error-13435"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NotPrimaryNoSecondaryOk </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 13436 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-13436" 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-error-13436"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> NotPrimaryOrSecondary </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 14031 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-14031" 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-error-14031"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> OutOfDiskSpace </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <dl class="error"> <dt> <code class="leafygreen-ui-1l06pbn"> 46841 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-error-46841" 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-error-46841"> </div> </a> </dt> <dd> </dd> </dl> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ClientMarkedKilled </div> </div> </td> </tr> </tbody> </table> </div> </section>
https://www.mongodb.com/docs/manual/core/schema-validation/specify-json-schema/json-schema-tips/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Tips for JSON Schema Validation <a class="headerlink leafygreen-ui-1kepx47" href="#tips-for-json-schema-validation" 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="tips-for-json-schema-validation"> </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="#_id-field-and-additionalproperties--false" target="_self"> <span> <code class="css-1kekw28 e1wawog0"> _id </code> Field and <code class="css-1kekw28 e1wawog0"> additionalProperties: false </code> </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#validation-for-null-field-values" target="_self"> <span> Validation for <code class="css-1kekw28 e1wawog0"> null </code> Field Values </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#validation-with-encrypted-fields" target="_self"> <span> Validation with Encrypted Fields </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> This page describes best practices for JSON schema validation to help avoid common issues. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> <code class="leafygreen-ui-1l06pbn"> _id </code> Field and <code class="leafygreen-ui-1l06pbn"> additionalProperties: false </code> <a class="headerlink leafygreen-ui-1kepx47" href="#_id-field-and-additionalproperties--false" 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="_id-field-and-additionalproperties--false"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> When you specify <code class="leafygreen-ui-1l06pbn"> additionalProperties: false </code> in your JSON schema, MongoDB rejects documents that contain fields not included in your schema's <code class="leafygreen-ui-1l06pbn"> properties </code> object. </p> <p class="leafygreen-ui-1kp3ins"> Because all objects contain an automatically-generated <code class="leafygreen-ui-1l06pbn"> _id </code> field, when you set <code class="leafygreen-ui-1l06pbn"> additionalProperties: false </code> , you must include the <code class="leafygreen-ui-1l06pbn"> _id </code> field in your <code class="leafygreen-ui-1l06pbn"> properties </code> object. If you don't, all documents are rejected. </p> <p class="leafygreen-ui-1kp3ins"> For example, with this validation, no documents are valid: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"$jsonSchema\": {\n \"required\": [ \"_id\", \"storeLocation\" ],\n \"properties\": {\n \"storeLocation\": { \"bsonType\": \"string\" }\n },\n \"additionalProperties\": false\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$jsonSchema"</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"required"</span>: <!-- -->[ <span class="lg-highlight-string">"_id"</span>, <span class="lg-highlight-string">"storeLocation"</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"properties"</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"storeLocation"</span>: <!-- -->{ <span class="lg-highlight-string">"bsonType"</span>: <span class="lg-highlight-string">"string"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"additionalProperties"</span>: <span class="lg-highlight-literal">false</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This validation ensures that <code class="leafygreen-ui-1l06pbn"> storeLocation </code> is a string. However, the <code class="leafygreen-ui-1l06pbn"> properties </code> object does not contain an <code class="leafygreen-ui-1l06pbn"> _id </code> field. </p> <p class="leafygreen-ui-1kp3ins"> To allow documents in the collection, you must update the <code class="leafygreen-ui-1l06pbn"> properties </code> object to include an <code class="leafygreen-ui-1l06pbn"> _id </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"$jsonSchema\": {\n \"required\": [ \"_id\", \"storeLocation\" ],\n \"properties\": {\n \"_id\": { \"bsonType\": \"objectId\" },\n \"storeLocation\": { \"bsonType\": \"string\" }\n },\n \"additionalProperties\": false\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$jsonSchema"</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"required"</span>: <!-- -->[ <span class="lg-highlight-string">"_id"</span>, <span class="lg-highlight-string">"storeLocation"</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"properties"</span>: <!-- -->{</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span>: <!-- -->{ <span class="lg-highlight-string">"bsonType"</span>: <span class="lg-highlight-string">"objectId"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"storeLocation"</span>: <!-- -->{ <span class="lg-highlight-string">"bsonType"</span>: <span class="lg-highlight-string">"string"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"additionalProperties"</span>: <span class="lg-highlight-literal">false</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Validation for <code class="leafygreen-ui-1l06pbn"> null </code> Field Values <a class="headerlink leafygreen-ui-1kepx47" href="#validation-for-null-field-values" 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="validation-for-null-field-values"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Your application may be configured to set missing field values to <code class="leafygreen-ui-1l06pbn"> null </code> , instead of not including those fields in the object sent to the collection. </p> <p class="leafygreen-ui-1kp3ins"> If your schema validates data types for a field, to insert documents with a <code class="leafygreen-ui-1l06pbn"> null </code> value for that field, you must explicitly allow <code class="leafygreen-ui-1l06pbn"> null </code> as a valid BSON type. </p> <p class="leafygreen-ui-1kp3ins"> For example, this schema validation does not allow documents where <code class="leafygreen-ui-1l06pbn"> storeLocation </code> is <code class="leafygreen-ui-1l06pbn"> null </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection(\"sales\",\n {\n validator:\n {\n \"$jsonSchema\": {\n \"properties\": {\n \"storeLocation\": { \"bsonType\": \"string\" }\n }\n }\n }\n }\n )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>(<span class="lg-highlight-string">"sales"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">validator</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$jsonSchema"</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"properties"</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"storeLocation"</span>: <!-- -->{ <span class="lg-highlight-string">"bsonType"</span>: <span class="lg-highlight-string">"string"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> With the preceding validation, this document is rejected: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.store.insertOne( { storeLocation: null } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">store</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>( <!-- -->{ <span class="lg-highlight-attr">storeLocation</span>: <span class="lg-highlight-literal">null</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"> Alternatively, this schema validation allows <code class="leafygreen-ui-1l06pbn"> null </code> values for <code class="leafygreen-ui-1l06pbn"> storeLocation </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection(\"store\",\n {\n validator:\n {\n \"$jsonSchema\": {\n \"properties\": {\n \"storeLocation\": { \"bsonType\": [ \"null\", \"string\" ] }\n }\n }\n }\n }\n )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>(<span class="lg-highlight-string">"store"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">validator</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$jsonSchema"</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"properties"</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"storeLocation"</span>: <!-- -->{ <span class="lg-highlight-string">"bsonType"</span>: <!-- -->[ <span class="lg-highlight-string">"null"</span>, <span class="lg-highlight-string">"string"</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> With the preceding validation, this document is allowed: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.store.insertOne( { storeLocation: null } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">store</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>( <!-- -->{ <span class="lg-highlight-attr">storeLocation</span>: <span class="lg-highlight-literal">null</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-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> null Fields Compared with Missing Fields </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> null </code> field values are not the same as missing fields. If a field is missing from a document, MongoDB does not validate that field. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Validation with Encrypted Fields <a class="headerlink leafygreen-ui-1kepx47" href="#validation-with-encrypted-fields" 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="validation-with-encrypted-fields"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If you have <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/#std-label-manual-csfle-feature"> Client-Side Field Level Encryption </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/#std-label-qe-manual-feature-qe"> Queryable Encryption </a> enabled on a collection, validation is subject to the following restrictions: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For CSFLE, when running <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> , the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/libmongocrypt/#std-label-qe-reference-libmongocrypt"> libmongocrypt </a> library prefers the the JSON <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/fundamentals/create-schema/#std-label-csfle-fundamentals-create-schema"> encryption schema </a> specified in the command. This enables setting a schema on a collection that does not yet have one. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For Queryable Encryption, any JSON schema that includes an encrypted field results in a query analysis error. </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/updateRole/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> updateRole <a class="headerlink leafygreen-ui-1kepx47" href="#updaterole" 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="updaterole"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#command-fields" target="_self"> <span> Command Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#required-access" target="_self"> <span> Required Access </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> updateRole </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.updateRole" 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-dbcommand-dbcmd.updateRole"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Updates a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-user-defined-roles/#std-label-user-defined-roles"> user-defined role </a> . The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.updateRole" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> updateRole </code> </span> </a> command must run on the role's database. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> In <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#std-program-mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , this command can also be run through the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.updateRole/#mongodb-method-db.updateRole"> <code class="leafygreen-ui-1l06pbn"> db.updateRole() </code> </a> helper method <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> Helper methods are convenient for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#std-program-mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> users, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> An update to a field <strong> completely replaces </strong> the previous field's values. To grant or remove roles or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/#std-label-privileges"> privileges </a> without replacing all values, use one or more of the following commands: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/grantRolesToRole/#mongodb-dbcommand-dbcmd.grantRolesToRole"> <code class="leafygreen-ui-1l06pbn"> grantRolesToRole </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/grantPrivilegesToRole/#mongodb-dbcommand-dbcmd.grantPrivilegesToRole"> <code class="leafygreen-ui-1l06pbn"> grantPrivilegesToRole </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/revokeRolesFromRole/#mongodb-dbcommand-dbcmd.revokeRolesFromRole"> <code class="leafygreen-ui-1l06pbn"> revokeRolesFromRole </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/revokePrivilegesFromRole/#mongodb-dbcommand-dbcmd.revokePrivilegesFromRole"> <code class="leafygreen-ui-1l06pbn"> revokePrivilegesFromRole </code> </a> </p> </li> </ul> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> An update to the <code class="leafygreen-ui-1l06pbn"> privileges </code> or <code class="leafygreen-ui-1l06pbn"> roles </code> array completely replaces the previous array's values. </p> </div> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" 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="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </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/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <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 command is not supported in M0, M2, M5, and M10+ clusters. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To update a role, you must provide the <code class="leafygreen-ui-1l06pbn"> privileges </code> array, <code class="leafygreen-ui-1l06pbn"> roles </code> array, or both. </p> <p class="leafygreen-ui-1kp3ins"> The command uses the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand(\n {\n updateRole: \"&lt;role&gt;\",\n privileges:\n [\n { resource: { &lt;resource&gt; }, actions: [ \"&lt;action&gt;\", ... ] },\n ...\n ],\n roles:\n [\n { role: \"&lt;role&gt;\", db: \"&lt;database&gt;\" } | \"&lt;role&gt;\",\n ...\n ],\n authenticationRestrictions:\n [\n {\n clientSource: [\"&lt;ip&gt;\" | \"&lt;cidr&gt;\", ...],\n serverAddress: [\"&lt;ip&gt;\", ...]\n },\n ...\n ]\n writeConcern: &lt;write&gt;,\n comment: &lt;any&gt;\n }\n )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">updateRole</span>: <span class="lg-highlight-string">"&lt;role&gt;"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">privileges</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">resource</span>: <!-- -->{ &lt;<!-- -->resource<!-- -->&gt; <!-- -->}<!-- -->, <span class="lg-highlight-attr">actions</span>: <!-- -->[ <span class="lg-highlight-string">"&lt;action&gt;"</span>, <!-- -->...<!-- --> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"&lt;role&gt;"</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"&lt;database&gt;"</span> } <!-- -->| <span class="lg-highlight-string">"&lt;role&gt;"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">authenticationRestrictions</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">clientSource</span>: <!-- -->[<span class="lg-highlight-string">"&lt;IP&gt;"</span> <!-- -->| <span class="lg-highlight-string">"&lt;CIDR range&gt;"</span>, <!-- -->...<!-- -->]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">serverAddress</span>: <!-- -->[<span class="lg-highlight-string">"&lt;IP&gt;"</span>, <!-- -->...<!-- -->]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">writeConcern</span>: <!-- -->&lt;write concern document&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> comment: &lt;any&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Command Fields <a class="headerlink leafygreen-ui-1kepx47" href="#command-fields" 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="command-fields"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command takes the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> updateRole </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The name of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-user-defined-roles/#std-label-user-defined-roles"> user-defined role </a> role to update. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> privileges </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> array </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. Required if you do not specify <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-roles-collection/#mongodb-data-admin.system.roles.roles"> <code class="leafygreen-ui-1l06pbn"> roles </code> </a> array. The privileges to grant the role. An update to the <code class="leafygreen-ui-1l06pbn"> privileges </code> array overrides the previous array's values. For the syntax for specifying a privilege, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-roles-collection/#mongodb-data-admin.system.roles.privileges"> <code class="leafygreen-ui-1l06pbn"> privileges </code> </a> array. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> roles </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> array </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. Required if you do not specify <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-roles-collection/#mongodb-data-admin.system.roles.privileges"> <code class="leafygreen-ui-1l06pbn"> privileges </code> </a> array. The roles from which this role inherits privileges. An update to the <code class="leafygreen-ui-1l06pbn"> roles </code> array overrides the previous array's values. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> authenticationRestrictions </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> array </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. </p> <p class="leafygreen-ui-1kp3ins"> The authentication restrictions the server enforces on the role. Specifies a list of IP addresses and <span class="leafygreen-ui-vm4wms" tabindex="0"> CIDR </span> ranges users granted this role are allowed to connect to and/or which they can connect from. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> writeConcern </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The level of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern"> write concern </a> for the operation. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-specs"> Write Concern Specification <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> comment </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> any </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. A user-provided comment to attach to this command. Once set, this comment appears alongside records of this command in the following locations: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-messages-ref"> mongod log messages </a> , in the <code class="leafygreen-ui-1l06pbn"> attr.command.cursor.comment </code> field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/database-profiler/#std-label-profiler"> Database profiler </a> output, in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/database-profiler/#mongodb-data-system.profile.command"> <code class="leafygreen-ui-1l06pbn"> command.comment </code> </a> field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-dbcommand-dbcmd.currentOp"> <code class="leafygreen-ui-1l06pbn"> currentOp </code> </a> output, in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-data-currentOp.command"> <code class="leafygreen-ui-1l06pbn"> command.comment </code> </a> field. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> A comment can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-bson-types"> BSON type </a> (string, integer, object, array, etc). </p> </div> </div> </td> </tr> </tbody> </table> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Roles <a class="headerlink leafygreen-ui-1kepx47" href="#roles" 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="roles"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> In the <code class="leafygreen-ui-1l06pbn"> roles </code> field, you can specify both <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-built-in-roles"> built-in roles </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-user-defined-roles/#std-label-user-defined-roles"> user-defined roles <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To specify a role that exists in the same database where <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.updateRole" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> updateRole </code> </span> </a> runs, you can either specify the role with the name of the role: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"readWrite\"","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string">"readWrite"</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"> Or you can specify the role with a document, as in: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ role: \"&lt;role&gt;\", db: \"&lt;database&gt;\" }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"&lt;role&gt;"</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"&lt;database&gt;"</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To specify a role that exists in a different database, specify the role with a document. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Authentication Restrictions <a class="headerlink leafygreen-ui-1kepx47" href="#authentication-restrictions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="authentication-restrictions"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> authenticationRestrictions </code> document can contain <em> only </em> the following fields. The server throws an error if the <code class="leafygreen-ui-1l06pbn"> authenticationRestrictions </code> document contains an unrecognized field: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:30%"/> <col style="width:50%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> clientSource </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Array of IP addresses and/or <span class="leafygreen-ui-vm4wms" tabindex="0"> CIDR </span> ranges </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> If present, when authenticating a user, the server verifies that the client's IP address is either in the given list or belongs to a CIDR range in the list. If the client's IP address is not present, the server does not authenticate the user. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> serverAddress </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Array of IP addresses and/or <span class="leafygreen-ui-vm4wms" tabindex="0"> CIDR </span> ranges </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> A list of IP addresses or CIDR ranges to which the client can connect. If present, the server will verify that the client's connection was accepted via an IP address in the given list. If the connection was accepted via an unrecognized IP address, the server does not authenticate the user. </div> </div> </td> </tr> </tbody> </table> </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"> If a user inherits multiple roles with incompatible authentication restrictions, that user becomes unusable. </p> <p class="leafygreen-ui-1kp3ins"> For example, if a user inherits one role in which the <code class="leafygreen-ui-1l06pbn"> clientSource </code> field is <code class="leafygreen-ui-1l06pbn"> ["198.51.100.0"] </code> and another role in which the <code class="leafygreen-ui-1l06pbn"> clientSource </code> field is <code class="leafygreen-ui-1l06pbn"> ["203.0.113.0"] </code> the server is unable to authenticate the user. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on authentication in MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-authentication"> Authentication on Self-Managed Deployments <!-- --> . </a> </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A role's privileges apply to the database where the role is created. The role can inherit privileges from other roles in its database. A role created on the <code class="leafygreen-ui-1l06pbn"> admin </code> database can include privileges that apply to all databases or to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/resource-document/#std-label-resource-cluster"> cluster </a> and can inherit privileges from roles in other databases. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Required Access <a class="headerlink leafygreen-ui-1kepx47" href="#required-access" 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="required-access"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You must have the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-revokeRole"> <code class="leafygreen-ui-1l06pbn"> revokeRole </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#std-label-security-user-actions"> action </a> on all databases in order to update a role. </p> <p class="leafygreen-ui-1kp3ins"> You must have the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-grantRole"> <code class="leafygreen-ui-1l06pbn"> grantRole </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#std-label-security-user-actions"> action </a> on the database of each role in the <code class="leafygreen-ui-1l06pbn"> roles </code> array to update the array. </p> <p class="leafygreen-ui-1kp3ins"> You must have the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-grantRole"> <code class="leafygreen-ui-1l06pbn"> grantRole </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#std-label-security-user-actions"> action </a> on the database of each privilege in the <code class="leafygreen-ui-1l06pbn"> privileges </code> array to update the array. If a privilege's resource spans databases, you must have <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-grantRole"> <code class="leafygreen-ui-1l06pbn"> grantRole </code> </a> on the <code class="leafygreen-ui-1l06pbn"> admin </code> database. A privilege spans databases if the privilege is any of the following: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> a collection in all databases </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> all collections and all database </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the <code class="leafygreen-ui-1l06pbn"> cluster </code> resource </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> You must have the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-setAuthenticationRestriction"> <code class="leafygreen-ui-1l06pbn"> setAuthenticationRestriction </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#std-label-security-user-actions"> action </a> on the database of the target role to update a role's <code class="leafygreen-ui-1l06pbn"> authenticationRestrictions </code> document. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following is an example of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.updateRole" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> updateRole </code> </span> </a> command that updates the <code class="leafygreen-ui-1l06pbn"> myClusterwideAdmin </code> role on the <code class="leafygreen-ui-1l06pbn"> admin </code> database. While the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-roles-collection/#mongodb-data-admin.system.roles.privileges"> <code class="leafygreen-ui-1l06pbn"> privileges </code> </a> and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-roles-collection/#mongodb-data-admin.system.roles.roles"> <code class="leafygreen-ui-1l06pbn"> roles </code> </a> arrays are both optional, at least one of the two is required: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand(\n {\n updateRole: \"myClusterwideAdmin\",\n privileges:\n [\n {\n resource: { db: \"\", collection: \"\" },\n actions: [ \"find\" , \"update\", \"insert\", \"remove\" ]\n }\n ],\n roles:\n [\n { role: \"dbAdminAnyDatabase\", db: \"admin\" }\n ],\n writeConcern: { w: \"majority\" }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">updateRole</span>: <span class="lg-highlight-string">"myClusterwideAdmin"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">privileges</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">resource</span>: <!-- -->{ <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">""</span>, <span class="lg-highlight-attr">collection</span>: <span class="lg-highlight-string">""</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">actions</span>: <!-- -->[ <span class="lg-highlight-string">"find"</span> <!-- -->, <span class="lg-highlight-string">"update"</span>, <span class="lg-highlight-string">"insert"</span>, <span class="lg-highlight-string">"remove"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"dbAdminAnyDatabase"</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"admin"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">writeConcern</span>: <!-- -->{ <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-string">"majority"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To view a role's privileges, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/rolesInfo/#mongodb-dbcommand-dbcmd.rolesInfo"> <code class="leafygreen-ui-1l06pbn"> rolesInfo </code> </a> command. </p> </section> </section>
https://www.mongodb.com/docs/manual/appendix/security/appendixC-openssl-client/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Appendix C - OpenSSL Client Certificates for Testing Self-Managed Deployments <a class="headerlink leafygreen-ui-1kepx47" href="#appendix-c---openssl-client-certificates-for-testing-self-managed-deployments" 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="appendix-c---openssl-client-certificates-for-testing-self-managed-deployments"> </div> </a> </h1> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Disclaimer </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page is provided for <strong class="css-4dei7l"> testing purposes </strong> only and the certificates are for <strong class="css-4dei7l"> testing purposes only </strong> . </p> <p class="leafygreen-ui-1kp3ins"> The following tutorial provides some basic steps for creating <strong class="css-4dei7l"> test </strong> x.509 certificates. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Do not use these certificates for production. Instead, follow your security policies. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For information on OpenSSL, refer to the official OpenSSL docs. Although this tutorial uses OpenSSL, the material should not be taken as an authoritative reference on OpenSSL. </p> </li> </ul> </div> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Prerequisite <a class="headerlink leafygreen-ui-1kepx47" href="#prerequisite" 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="prerequisite"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The procedure outlined on this page uses the <strong class="css-4dei7l"> test </strong> intermediate authority certificate and key <code class="file docutils literal"> <span class="pre"> mongodb-test-ia.crt </span> </code> and <code class="file docutils literal"> <span class="pre"> mongodb-test-ia.key </span> </code> created in <a class="leafygreen-ui-tqgtui" href="/docs/manual/appendix/security/appendixA-openssl-ca/"> Appendix A - OpenSSL CA Certificate for Testing Self-Managed Deployments <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#procedure" 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="procedure"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following procedure outlines the steps to create <strong class="css-4dei7l"> test </strong> certificates for MongoDB clients. For steps to create <strong class="css-4dei7l"> test </strong> certificates for MongoDB servers, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/appendix/security/appendixB-openssl-server/"> Appendix B - OpenSSL Server Certificates for Testing Self-Managed Deployments <!-- --> . </a> </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> A. Create the OpenSSL Configuration File <a class="headerlink leafygreen-ui-1kepx47" href="#a.-create-the-openssl-configuration-file" 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="a.-create-the-openssl-configuration-file"> </div> </a> </h3> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create a <strong class="css-4dei7l"> test </strong> configuration file <code class="leafygreen-ui-1l06pbn"> openssl-test-client.cnf </code> for your client with the following content: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"# NOT FOR PRODUCTION USE. OpenSSL configuration file for testing.\n\n[ req ]\ndefault_bits = 4096\ndefault_keyfile = myTestClientCertificateKey.pem ## The default private key file name.\ndefault_md = sha256\ndistinguished_name = req_dn\nreq_extensions = v3_req\n\n\n[ v3_req ]\nsubjectKeyIdentifier = hash\nbasicConstraints = CA:FALSE\nkeyUsage = critical, digitalSignature, keyEncipherment\nnsComment = \"OpenSSL Generated Certificate for TESTING only. NOT FOR PRODUCTION USE.\"\nextendedKeyUsage = serverAuth, clientAuth\n\n\n[ req_dn ]\ncountryName = Country Name (2 letter code)\ncountryName_default =\ncountryName_min = 2\ncountryName_max = 2\n\nstateOrProvinceName = State or Province Name (full name)\nstateOrProvinceName_default = TestClientCertificateState\nstateOrProvinceName_max = 64\n\nlocalityName = Locality Name (eg, city)\nlocalityName_default = TestClientCertificateLocality\nlocalityName_max = 64\n\norganizationName = Organization Name (eg, company)\norganizationName_default = TestClientCertificateOrg\norganizationName_max = 64\n\norganizationalUnitName = Organizational Unit Name (eg, section)\norganizationalUnitName_default = TestClientCertificateOrgUnit\norganizationalUnitName_max = 64\ncommonName = Common Name (eg, YOUR name)\ncommonName_max = 64"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"># NOT FOR PRODUCTION USE. OpenSSL configuration file for testing.</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">[ req ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">default_bits = 4096</td></tr><tr class=""><td class="leafygreen-ui-7razhx">default_keyfile = myTestClientCertificateKey.pem ## The default private key file name.</td></tr><tr class=""><td class="leafygreen-ui-7razhx">default_md = sha256</td></tr><tr class=""><td class="leafygreen-ui-7razhx">distinguished_name = req_dn</td></tr><tr class=""><td class="leafygreen-ui-7razhx">req_extensions = v3_req</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">[ v3_req ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">subjectKeyIdentifier = hash</td></tr><tr class=""><td class="leafygreen-ui-7razhx">basicConstraints = CA:FALSE</td></tr><tr class=""><td class="leafygreen-ui-7razhx">keyUsage = critical, digitalSignature, keyEncipherment</td></tr><tr class=""><td class="leafygreen-ui-7razhx">nsComment = "OpenSSL Generated Certificate for TESTING only. NOT FOR PRODUCTION USE."</td></tr><tr class=""><td class="leafygreen-ui-7razhx">extendedKeyUsage = serverAuth, clientAuth</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">[ req_dn ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">countryName = Country Name (2 letter code)</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">countryName_default =</td></tr><tr class=""><td class="leafygreen-ui-7razhx">countryName_min = 2</td></tr><tr class=""><td class="leafygreen-ui-7razhx">countryName_max = 2</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">stateOrProvinceName = State or Province Name (full name)</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">stateOrProvinceName_default = TestClientCertificateState</td></tr><tr class=""><td class="leafygreen-ui-7razhx">stateOrProvinceName_max = 64</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">localityName = Locality Name (eg, city)</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">localityName_default = TestClientCertificateLocality</td></tr><tr class=""><td class="leafygreen-ui-7razhx">localityName_max = 64</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">organizationName = Organization Name (eg, company)</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">organizationName_default = TestClientCertificateOrg</td></tr><tr class=""><td class="leafygreen-ui-7razhx">organizationName_max = 64</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">organizationalUnitName = Organizational Unit Name (eg, section)</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">organizationalUnitName_default = TestClientCertificateOrgUnit</td></tr><tr class=""><td class="leafygreen-ui-7razhx">organizationalUnitName_max = 64</td></tr><tr class=""><td class="leafygreen-ui-7razhx">commonName = Common Name (eg, YOUR name)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">commonName_max = 64</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <em> Optional </em> . You can update the default Distinguished Name (DN) values. Ensure that client certificates differ from server certificates with regards to at least one of the following attributes: Organization ( <code class="leafygreen-ui-1l06pbn"> O </code> ), the Organizational Unit ( <code class="leafygreen-ui-1l06pbn"> OU </code> ) or the Domain Component ( <code class="leafygreen-ui-1l06pbn"> DC </code> ). </p> </li> </ol> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> B. Generate the Test PEM File for Client <a class="headerlink leafygreen-ui-1kepx47" href="#b.-generate-the-test-pem-file-for-client" 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="b.-generate-the-test-pem-file-for-client"> </div> </a> </h3> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create the <strong class="css-4dei7l"> test </strong> key file <code class="file docutils literal"> <span class="pre"> mongodb-test-client.key </span> </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"openssl genrsa -out mongodb-test-client.key 4096","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">openssl genrsa -out mongodb-test-client.key 4096</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create the <strong class="css-4dei7l"> test </strong> certificate signing request <code class="file docutils literal"> <span class="pre"> mongodb-test-client.csr </span> </code> . When asked for Distinguished Name values, enter the appropriate values for your <strong class="css-4dei7l"> test </strong> certificate: </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 client certificate subject must differ to a server certificate subject with regards to at least one of the following attributes: Organization (O), the Organizational Unit (OU) or the Domain Component (DC). </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"openssl req -new -key mongodb-test-client.key -out mongodb-test-client.csr -config openssl-test-client.cnf","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">openssl req -new -key mongodb-test-client.key -out mongodb-test-client.csr -config openssl-test-client.cnf</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create the <strong class="css-4dei7l"> test </strong> client certificate <code class="file docutils literal"> <span class="pre"> mongodb-test-client.crt </span> </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"openssl x509 -sha256 -req -days 365 -in mongodb-test-client.csr -CA mongodb-test-ia.crt -CAkey mongodb-test-ia.key -CAcreateserial -out mongodb-test-client.crt -extfile openssl-test-client.cnf -extensions v3_req","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">openssl x509 -sha256 -req -days 365 -<span class="lg-highlight-keyword">in</span> mongodb-test-client.csr -CA mongodb-test-ia.crt -CAkey mongodb-test-ia.key -CAcreateserial -out mongodb-test-client.crt -extfile openssl-test-client.cnf -extensions v3_req</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create the <strong class="css-4dei7l"> test </strong> PEM file for the client. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cat mongodb-test-client.crt mongodb-test-client.key &gt; test-client.pem","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"><span class="lg-highlight-built_in">cat</span> mongodb-test-client.crt mongodb-test-client.key &gt; test-client.pem</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"> You can use the <strong class="css-4dei7l"> test </strong> PEM file to configure <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> for TLS/SSL <strong class="css-4dei7l"> testing </strong> . For example, to connect to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> : </a> </p> <div class="leafygreen-ui-vg7qwp" role="note"> <h2 class="leafygreen-ui-2xicti"> Example </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Include the following options for the client: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh --tls --host &lt;serverhost&gt; --tlsCertificateKeyFile test-client.pem --tlsCAFile test-ca.pem","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">mongosh <!-- -->-<!-- -->-<!-- -->tls <!-- -->-<!-- -->-<!-- -->host <!-- -->&lt;<!-- -->serverHost<!-- -->&gt; <!-- -->-<!-- -->-<!-- -->tlsCertificateKeyFile test<!-- -->-<!-- -->client.<span class="lg-highlight-property">pem</span> <!-- -->-<!-- -->-<!-- -->tlsCAFile test<!-- -->-<!-- -->ca.<span class="lg-highlight-property">pem</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> </div> <dl> <dt> On macOS, </dt> <dd class="css-1ufxuu7"> <p class="leafygreen-ui-1kp3ins"> If you are <strong class="css-4dei7l"> testing </strong> with Keychain Access to manage certificates, create a PKCS 12 file to add to Keychain Access instead of a PEM file: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"openssl pkcs12 -export -out test-client.pfx -inkey mongodb-test-client.key -in mongodb-test-client.crt -certfile mongodb-test-ia.crt","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">openssl pkcs12 -<span class="lg-highlight-built_in">export</span> -out test-client.pfx -inkey mongodb-test-client.key -<span class="lg-highlight-keyword">in</span> mongodb-test-client.crt -certfile mongodb-test-ia.crt</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"> Once added to Keychain Access, instead of specifying the Certificate Key file, you can use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-option-mongosh.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> to specify the certificate to use. If the CA file is also in Keychain Access, you can omit <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> as well as in the following example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh --tls --tlsCertificateSelector subject=\"&lt;testclientcertificatecommonname&gt;\"","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">mongosh <!-- -->-<!-- -->-<!-- -->tls <!-- -->-<!-- -->-<!-- -->tlsCertificateSelector subject<!-- -->=<span class="lg-highlight-string">"&lt;TestClientCertificateCommonName&gt;"</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For adding certificates to Keychain Access, refer to your official documentation for Keychain Access. </p> </dd> </dl> </li> </ol> <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"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/appendix/security/appendixA-openssl-ca/#std-label-appendix-ca-certificate"> Appendix A - OpenSSL CA Certificate for Testing Self-Managed Deployments </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/appendix/security/appendixB-openssl-server/#std-label-appendix-server-certificate"> Appendix B - OpenSSL Server Certificates for Testing Self-Managed Deployments </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-x509-client-authentication/#std-label-x509-client-authentication"> Use x.509 Certificates to Authenticate Clients on Self-Managed Deployments </a> </p> </li> </ul> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-enterprise-on-suse/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Install MongoDB Enterprise Edition on SUSE <a class="headerlink leafygreen-ui-1kepx47" href="#install-mongodb-enterprise-edition-on-suse" 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="install-mongodb-enterprise-edition-on-suse"> </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="#considerations" target="_self"> <span> Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#install-mongodb-enterprise-edition" target="_self"> <span> Install MongoDB Enterprise Edition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#run-mongodb-enterprise-edition" target="_self"> <span> Run MongoDB Enterprise Edition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#uninstall-mongodb" target="_self"> <span> Uninstall MongoDB </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#additional-information" target="_self"> <span> Additional Information </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"> Use this tutorial to install MongoDB 8.0 <!-- --> Enterprise <!-- --> Edition on SUSE Linux Enterprise Server (SLES) using the <code class="leafygreen-ui-1l06pbn"> zypper </code> package manager. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/products/mongodb-enterprise-advanced?tck=docs_server" target="_self"> <span> MongoDB Enterprise Edition </span> </a> is available on select platforms and contains support for several features related to security and monitoring. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> MongoDB Version <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-version" 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-version"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> This tutorial installs MongoDB 8.0 <!-- --> Enterprise <!-- --> Edition. To install a different version of MongoDB <!-- --> Enterprise <!-- --> , use the version drop-down menu in the upper-left corner of this page to select the documentation for that version. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#considerations" 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="considerations"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Platform Support <a class="headerlink leafygreen-ui-1kepx47" href="#platform-support" 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="platform-support"> </div> </a> </h3> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> EOL Notice </strong> </h3> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 Enterprise Edition removes support for SLES12 on <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/production-notes/#std-label-prod-notes-supported-platforms-s390x"> s390x </a> </p> </li> </ul> </div> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB 8.0 Enterprise Edition supports the following <strong class="css-4dei7l"> 64-bit </strong> SUSE Linux Enterprise Server (SLES) releases on <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/production-notes/#std-label-prod-notes-supported-platforms-x86_64"> x86_64 </a> architecture: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <span class="leafygreen-ui-vm4wms" tabindex="0"> SLES </span> 15 </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> MongoDB only supports the 64-bit versions of these platforms. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/production-notes/#std-label-prod-notes-supported-platforms"> Platform Support </a> for more information. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Production Notes <a class="headerlink leafygreen-ui-1kepx47" href="#production-notes" 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="production-notes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Before deploying MongoDB in a production environment, consider the <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/production-notes/"> Production Notes for Self-Managed Deployments </a> document which offers performance considerations and configuration recommendations for production MongoDB deployments. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-install-enterprise-suse-pkg"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Install MongoDB Enterprise Edition <a class="headerlink leafygreen-ui-1kepx47" href="#install-mongodb-enterprise-edition" 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="install-mongodb-enterprise-edition"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Follow these steps to install MongoDB <!-- --> Enterprise <!-- --> Edition using the <code class="leafygreen-ui-1l06pbn"> zypper </code> package manager. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Import the MongoDB public key."},{"@type":"HowToStep","text":"Add the MongoDB repository.Add the repository so that you can install MongoDB. Use the command\nappropriate for your version of SUSE:"},{"@type":"HowToStep","text":"Install the MongoDB packages.To install MongoDB 8.0, issue the following\ncommand:To install a specific release of MongoDB, specify each\ncomponent package individually and append the version number to the\npackage name, as in the following example:You can specify any available version of MongoDB. However zypper\nupgrades the packages when a newer version becomes available. To\nprevent unintended upgrades, pin the packages by running the following\ncommand:Previous versions of MongoDB packages use a different repository location.\nRefer to the version of the documentation appropriate for\nyour MongoDB version."}],"name":"Install MongoDB Enterprise Edition","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Import the MongoDB public key. <a class="headerlink leafygreen-ui-1kepx47" href="#import-the-mongodb-public-key" 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="import-the-mongodb-public-key"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo rpm --import https://pgp.mongodb.com/server-8.0.asc\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo rpm --import https://pgp.mongodb.com/server-8.0.asc</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Add the MongoDB repository. <a class="headerlink leafygreen-ui-1kepx47" href="#add-the-mongodb-repository" 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="add-the-mongodb-repository"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Add the repository so that you can install MongoDB. Use the command appropriate for your version of SUSE: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo zypper addrepo --gpgcheck \"https://repo.mongodb.com/zypper/suse/15/mongodb-enterprise/8.0/x86_64/\" mongodb","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">sudo zypper addrepo --gpgcheck <span class="lg-highlight-string">"https://repo.mongodb.com/zypper/suse/15/mongodb-enterprise/8.0/x86_64/"</span> mongodb</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Install the MongoDB packages. <a class="headerlink leafygreen-ui-1kepx47" href="#install-the-mongodb-packages" 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="install-the-mongodb-packages"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To install MongoDB 8.0, issue the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo zypper -n install mongodb-enterprise\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo zypper -n install mongodb-enterprise</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"> To install a specific release of MongoDB, specify each component package individually and append the version number to the package name, as in the following example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo zypper install mongodb-enterprise-8.0.0 mongodb-enterprise-database-8.0.0 mongodb-enterprise-server-8.0.0 mongodb-mongosh mongodb-enterprise-mongos-8.0.0 mongodb-enterprise-tools-8.0.0\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo zypper install mongodb-enterprise-8.0.0 mongodb-enterprise-database-8.0.0 mongodb-enterprise-server-8.0.0 mongodb-mongosh mongodb-enterprise-mongos-8.0.0 mongodb-enterprise-tools-8.0.0</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"> You can specify any available version of MongoDB. However <code class="leafygreen-ui-1l06pbn"> zypper </code> upgrades the packages when a newer version becomes available. To prevent unintended upgrades, pin the packages by running the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo zypper addlock mongodb-enterprise-8.0.0 mongodb-enterprise-database-8.0.0 mongodb-enterprise-server-8.0.0 mongodb-mongosh mongodb-enterprise-mongos-8.0.0 mongodb-enterprise-tools-8.0.0\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo zypper addlock mongodb-enterprise-8.0.0 mongodb-enterprise-database-8.0.0 mongodb-enterprise-server-8.0.0 mongodb-mongosh mongodb-enterprise-mongos-8.0.0 mongodb-enterprise-tools-8.0.0</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"> Previous versions of MongoDB packages use a different repository location. Refer to the version of the documentation appropriate for your MongoDB version. </p> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Run MongoDB Enterprise Edition <a class="headerlink leafygreen-ui-1kepx47" href="#run-mongodb-enterprise-edition" 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="run-mongodb-enterprise-edition"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> By default, a MongoDB instance stores: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> its data files in <code class="leafygreen-ui-1l06pbn"> /var/lib/mongo </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> its log files in <code class="leafygreen-ui-1l06pbn"> /var/log/mongodb </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If you installed via the package manager, these default directories are created during the installation. </p> <p class="leafygreen-ui-1kp3ins"> If you installed manually by downloading the tarballs, you can create the directories using <code class="leafygreen-ui-1l06pbn"> mkdir -p &lt;directory&gt; </code> or <code class="leafygreen-ui-1l06pbn"> sudo mkdir -p &lt;directory&gt; </code> depending on the user that will run MongoDB. (See your linux man pages for information on <code class="leafygreen-ui-1l06pbn"> mkdir </code> and <code class="leafygreen-ui-1l06pbn"> sudo </code> .) </p> <p class="leafygreen-ui-1kp3ins"> By default, MongoDB runs using the <code class="leafygreen-ui-1l06pbn"> mongod </code> user account. If you change the user that runs the MongoDB process, you <strong> must </strong> also modify the permission to the <code class="leafygreen-ui-1l06pbn"> /var/lib/mongo </code> and <code class="leafygreen-ui-1l06pbn"> /var/log/mongodb </code> directories to give this user access to these directories. </p> <p class="leafygreen-ui-1kp3ins"> To specify a different log file directory and data file directory, edit the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.path"> <code class="leafygreen-ui-1l06pbn"> systemLog.path </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> storage.dbPath </code> </a> settings in the <code class="leafygreen-ui-1l06pbn"> /etc/mongod.conf </code> . Ensure that the user running MongoDB has access to these directories. </p> <p class="leafygreen-ui-1kp3ins"> Most Unix-like operating systems limit the system resources that a process may use. These limits may negatively impact MongoDB operation, and should be adjusted. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/ulimit/"> UNIX <code class="leafygreen-ui-1l06pbn"> ulimit </code> Settings for Self-Managed Deployments </a> for the recommended settings for your platform. </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"> If the <code class="leafygreen-ui-1l06pbn"> ulimit </code> value for number of open files is under <code class="leafygreen-ui-1l06pbn"> 64000 </code> , MongoDB generates a startup warning. </p> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#procedure" 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="procedure"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Follow these steps to run MongoDB <!-- --> Enterprise <!-- --> Edition. These instructions assume that you are using the default settings. </p> <p class="leafygreen-ui-1kp3ins"> <strong> Init System </strong> </p> <p class="leafygreen-ui-1kp3ins"> To run and manage your <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process, you will be using your operating system's built-in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-init-system"> init system </a> . Recent versions of Linux tend to use <strong> systemd </strong> (which uses the <code class="leafygreen-ui-1l06pbn"> systemctl </code> command), while older versions of Linux tend to use <strong> System V init </strong> (which uses the <code class="leafygreen-ui-1l06pbn"> service </code> command). </p> <p class="leafygreen-ui-1kp3ins"> If you are unsure which init system your platform uses, run the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"ps --no-headers -o comm 1","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">ps --no-headers -o <span class="lg-highlight-built_in">comm</span> 1</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"> Then select the appropriate tab below based on the result: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> systemd </code> - select the <strong> systemd (systemctl) </strong> tab below. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> init </code> - select the <strong> System V Init (service) </strong> tab below. </p> </li> </ul> <div class="line-block"> <div class="line"> <br/> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-25"> <div aria-label="Tabs to describe usage of systemd-systemctl/systemvinit-service" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_whg9ztbne" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_g3wo2nbmf" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> systemd (systemctl) </div> </button> <button aria-controls="_xiw129arm" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_99xvi99aq" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> System V Init (service) </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_n967dwmxa" class="" id="_4sw14qcdw" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Start MongoDB.You can start the mongod process by issuing the\nfollowing command:If you receive an error similar to the following when starting\nmongod:Failed to start mongod.service: Unit mongod.service not found.Run the following command first:Then run the start command above again."},{"@type":"HowToStep","text":"Verify that MongoDB has started successfully.You can verify that the mongod process has started\nsuccessfully by issuing the following command:You can optionally ensure that MongoDB will start following a\nsystem reboot by issuing the following command:"},{"@type":"HowToStep","text":"Stop MongoDB.As needed, you can stop the mongod process by issuing the\nfollowing command:"},{"@type":"HowToStep","text":"Restart MongoDB.You can restart the mongod process by issuing the following\ncommand:You can follow the state of the process for errors or important messages\nby watching the output in the /var/log/mongodb/mongod.log file."},{"@type":"HowToStep","text":"Begin using MongoDB.Start a mongosh session on the same host machine as the\nmongod. You can run mongosh\nwithout any command-line options to connect to a\nmongod that is running on your localhost with default\nport 27017.For more information on connecting using mongosh,\nsuch as to connect to a mongod instance running\non a different host and/or port, see the\nmongosh documentation.To help you start using MongoDB, MongoDB provides Getting\nStarted Guides in various driver editions. For the\ndriver documentation, see Start Developing with MongoDB."}],"name":"Procedure - systemd (systemctl)","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Start MongoDB. <a class="headerlink leafygreen-ui-1kepx47" href="#start-mongodb" 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="start-mongodb"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> You can start the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process by issuing the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo systemctl start mongod\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo systemctl start mongod</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If you receive an error similar to the following when starting <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> : </a> </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> Failed to start mongod.service: Unit mongod.service not found. </code> </p> <p class="leafygreen-ui-1kp3ins"> Run the following command first: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo systemctl daemon-reload\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo systemctl daemon-reload</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"> Then run the start command above again. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Verify that MongoDB has started successfully. <a class="headerlink leafygreen-ui-1kepx47" href="#verify-that-mongodb-has-started-successfully" 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="verify-that-mongodb-has-started-successfully"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> You can verify that the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process has started successfully by issuing the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo systemctl status mongod\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo systemctl status mongod</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"> You can optionally ensure that MongoDB will start following a system reboot by issuing the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo systemctl enable mongod\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo systemctl enable mongod</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Stop MongoDB. <a class="headerlink leafygreen-ui-1kepx47" href="#stop-mongodb" 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="stop-mongodb"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> As needed, you can stop the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process by issuing the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo systemctl stop mongod\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo systemctl stop mongod</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Restart MongoDB. <a class="headerlink leafygreen-ui-1kepx47" href="#restart-mongodb" 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="restart-mongodb"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> You can restart the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process by issuing the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo systemctl restart mongod\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo systemctl restart mongod</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"> You can follow the state of the process for errors or important messages by watching the output in the <code class="leafygreen-ui-1l06pbn"> /var/log/mongodb/mongod.log </code> file. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Begin using MongoDB. <a class="headerlink leafygreen-ui-1kepx47" href="#begin-using-mongodb" 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="begin-using-mongodb"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Start 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> session on the same host machine as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> . You can run <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> without any command-line options to connect to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> that is running on your localhost with default port 27017. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\nmongosh\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on connecting using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , such as to connect to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance running on a different host and/or port, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/" target="_self"> <span> mongosh documentation <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> To help you start using MongoDB, MongoDB provides <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/getting-started/#std-label-getting-started"> Getting Started Guides </a> in various driver editions. For the driver documentation, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://api.mongodb.com/" target="_self"> <span> Start Developing with MongoDB <!-- --> . </span> </a> </p> </section> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_mg7ij42ko" class="leafygreen-ui-38lglc" id="_n2hvpswbs" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Start MongoDB.You can start the mongod process by issuing the following\ncommand:"},{"@type":"HowToStep","text":"Verify that MongoDB has started successfullyYou can verify that the mongod process has started\nsuccessfully by checking the contents of the log file at\n/var/log/mongodb/mongod.log\nfor a line readingwhere <port> is the port configured in /etc/mongod.conf, 27017 by default.You can optionally ensure that MongoDB will start following a system\nreboot by issuing the following command:"},{"@type":"HowToStep","text":"Stop MongoDB.As needed, you can stop the mongod process by issuing the\nfollowing command:"},{"@type":"HowToStep","text":"Restart MongoDB.You can restart the mongod process by issuing the following\ncommand:You can follow the state of the process for errors or important messages\nby watching the output in the /var/log/mongodb/mongod.log file."},{"@type":"HowToStep","text":"Begin using MongoDB.Start a mongosh session on the same host machine as the\nmongod. You can run mongosh\nwithout any command-line options to connect to a\nmongod that is running on your localhost with default\nport 27017.For more information on connecting using mongosh,\nsuch as to connect to a mongod instance running\non a different host and/or port, see the\nmongosh documentation.To help you start using MongoDB, MongoDB provides Getting\nStarted Guides in various driver editions. For the\ndriver documentation, see Start Developing with MongoDB."}],"name":"Procedure - System V Init (service)","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Start MongoDB. <a class="headerlink leafygreen-ui-1kepx47" href="#start-mongodb-1" 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="start-mongodb-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> You can start the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process by issuing the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo service mongod start\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo service mongod start</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Verify that MongoDB has started successfully <a class="headerlink leafygreen-ui-1kepx47" href="#verify-that-mongodb-has-started-successfully-1" 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="verify-that-mongodb-has-started-successfully-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> You can verify that the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process has started successfully by checking the contents of the log file at <code class="leafygreen-ui-1l06pbn"> /var/log/mongodb/mongod.log </code> for a line reading </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[initandlisten] waiting for connections on port &lt;port&gt;\n"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[initandlisten] waiting for connections on port &lt;port&gt;</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"> where <code class="leafygreen-ui-1l06pbn"> &lt;port&gt; </code> is the port configured in <code class="leafygreen-ui-1l06pbn"> /etc/mongod.conf </code> , <code class="leafygreen-ui-1l06pbn"> 27017 </code> by default. </p> <p class="leafygreen-ui-1kp3ins"> You can optionally ensure that MongoDB will start following a system reboot by issuing the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo chkconfig mongod on\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo chkconfig mongod on</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Stop MongoDB. <a class="headerlink leafygreen-ui-1kepx47" href="#stop-mongodb-1" 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="stop-mongodb-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> As needed, you can stop the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process by issuing the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo service mongod stop\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo service mongod stop</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Restart MongoDB. <a class="headerlink leafygreen-ui-1kepx47" href="#restart-mongodb-1" 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="restart-mongodb-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> You can restart the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process by issuing the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo service mongod restart\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo service mongod restart</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"> You can follow the state of the process for errors or important messages by watching the output in the <code class="leafygreen-ui-1l06pbn"> /var/log/mongodb/mongod.log </code> file. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Begin using MongoDB. <a class="headerlink leafygreen-ui-1kepx47" href="#begin-using-mongodb-1" 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="begin-using-mongodb-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Start 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> session on the same host machine as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> . You can run <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> without any command-line options to connect to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> that is running on your localhost with default port 27017. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\nmongosh\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on connecting using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , such as to connect to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance running on a different host and/or port, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/" target="_self"> <span> mongosh documentation <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> To help you start using MongoDB, MongoDB provides <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/getting-started/#std-label-getting-started"> Getting Started Guides </a> in various driver editions. For the driver documentation, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://api.mongodb.com/" target="_self"> <span> Start Developing with MongoDB <!-- --> . </span> </a> </p> </section> </div> </div> </div> </div> </div> </div> </div> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Uninstall MongoDB <a class="headerlink leafygreen-ui-1kepx47" href="#uninstall-mongodb" 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="uninstall-mongodb"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To completely remove MongoDB from a system, you must remove the MongoDB applications themselves, the configuration files, and any directories containing data and logs. The following section guides you through the necessary steps. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This process will <em> completely </em> remove MongoDB, its configuration, and <em> all </em> databases. This process is not reversible, so ensure that all of your configuration and data is backed up before proceeding. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Stop MongoDB.Stop the mongod process by issuing the following command:"},{"@type":"HowToStep","text":"Remove Packages.Remove any MongoDB packages that you had previously installed."},{"@type":"HowToStep","text":"Remove Data Directories.Remove MongoDB databases and log files."}],"name":"Uninstall MongoDB","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Stop MongoDB. <a class="headerlink leafygreen-ui-1kepx47" href="#stop-mongodb-2" 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="stop-mongodb-2"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Stop the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process by issuing the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo service mongod stop\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo service mongod stop</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Remove Packages. <a class="headerlink leafygreen-ui-1kepx47" href="#remove-packages" 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="remove-packages"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Remove any MongoDB packages that you had previously installed. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo zypper remove $(rpm -qa | grep mongodb-enterprise)\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo zypper remove $(rpm -qa | grep mongodb-enterprise)</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Remove Data Directories. <a class="headerlink leafygreen-ui-1kepx47" href="#remove-data-directories" 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="remove-data-directories"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Remove MongoDB databases and log files. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sudo rm -r /var/log/mongodb\nsudo rm -r /var/lib/mongo\n","programmingLanguage":"Shell"} </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 shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sudo rm -r /var/log/mongodb</td></tr><tr class=""><td class="leafygreen-ui-7razhx">sudo rm -r /var/lib/mongo</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> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Additional Information <a class="headerlink leafygreen-ui-1kepx47" href="#additional-information" 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="additional-information"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Localhost Binding by Default <a class="headerlink leafygreen-ui-1kepx47" href="#localhost-binding-by-default" 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="localhost-binding-by-default"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> By default, MongoDB launches with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> bindIp </code> </a> set to <code class="leafygreen-ui-1l06pbn"> 127.0.0.1 </code> , which binds to the localhost network interface. This means that the <code class="leafygreen-ui-1l06pbn"> mongod </code> can only accept connections from clients that are running on the same machine. Remote clients will not be able to connect to the <code class="leafygreen-ui-1l06pbn"> mongod </code> , and the <code class="leafygreen-ui-1l06pbn"> mongod </code> will not be able to initialize a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> unless this value is set to a valid network interface. </p> <p class="leafygreen-ui-1kp3ins"> This value can be configured either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> in the MongoDB configuration file with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> bindIp </code> </a> , or </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> via the command-line argument <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--bind_ip"> <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> </a> </p> </li> </ul> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Before you bind your instance to a publicly-accessible IP address, you must secure your cluster from unauthorized access. For a complete list of security recommendations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-security-checklist"> Security Checklist for Self-Managed Deployments </a> . At minimum, consider <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-checklist-auth"> enabling authentication </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-hardening/#std-label-network-config-hardening"> hardening network infrastructure <!-- --> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on configuring <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> bindIp </code> </a> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-mongodb-configuration/"> IP Binding in Self-Managed Deployments <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> MongoDB Enterprise Edition Packages <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-enterprise-edition-packages" 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-enterprise-edition-packages"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB Enterprise Edition is available from its own dedicated repository, and contains the following officially-supported packages: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:35%"/> <col style="width:65%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Package Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mongodb-enterprise </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> A <code class="leafygreen-ui-1l06pbn"> metapackage </code> that automatically installs the component packages listed below. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mongodb-enterprise-database </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> A <code class="leafygreen-ui-1l06pbn"> metapackage </code> that automatically installs the component packages listed below. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:50%"/> <col style="width:50%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Package Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mongodb-enterprise-server </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Contains the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> daemon and associated configuration and init scripts. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mongodb-enterprise-mongos </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Contains the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> daemon. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mongodb-enterprise-cryptd </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Contains the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/reference/encryption-components/#std-label-csfle-encryption-components"> mongocryptd </a> binary </div> </div> </td> </tr> </tbody> </table> </div> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mongodb-mongosh </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Contains the MongoDB Shell ( <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> ). </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mongodb-shared-openssl* </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Contains the MongoDB Shell that uses the OpenSSL version already installed on your computer ( <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> ). </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mongodb-enterprise-tools </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> A <code class="leafygreen-ui-1l06pbn"> metapackage </code> that automatically installs the component packages listed below: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:50%"/> <col style="width:50%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Package Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mongodb-database-tools </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Contains the following MongoDB database tools: </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/mongodump/#mongodb-binary-bin.mongodump" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongodump </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongorestore/#mongodb-binary-bin.mongorestore" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongorestore </code> </span> </a> </p> </li> <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/bsondump/#mongodb-binary-bin.bsondump" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> bsondump </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongoimport/#mongodb-binary-bin.mongoimport" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongoimport </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongoexport/#mongodb-binary-bin.mongoexport" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongoexport </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongostat/#mongodb-binary-bin.mongostat" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongostat </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongotop/#mongodb-binary-bin.mongotop" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongotop </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongofiles/#mongodb-binary-bin.mongofiles" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongofiles </code> </span> </a> </p> </li> </ul> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mongodb-enterprise-database-tools-extra </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Contains the following MongoDB support tools: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongoldap/#mongodb-binary-bin.mongoldap"> <code class="leafygreen-ui-1l06pbn"> mongoldap </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongokerberos/#mongodb-binary-bin.mongokerberos"> <code class="leafygreen-ui-1l06pbn"> mongokerberos </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/install_compass/#std-label-install-compass"> <code class="leafygreen-ui-1l06pbn"> install_compass </code> </a> script </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> mongodecrypt </code> binary </p> </li> </ul> </div> </div> </td> </tr> </tbody> </table> </div> </div> </div> </td> </tr> </tbody> </table> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/core/replica-set-write-concern/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Write Concern for Replica Sets <a class="headerlink leafygreen-ui-1kepx47" href="#write-concern-for-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-concern-for-replica-sets"> </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="#verify-write-operations-to-replica-sets" target="_self"> <span> Verify Write Operations to Replica Sets </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#modify-default-write-concern" target="_self"> <span> Modify Default Write Concern </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#custom-write-concerns" target="_self"> <span> Custom Write Concerns </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern"> Write concern </a> for replica sets describe the number of data-bearing members (i.e. the primary and secondaries, but not arbiters) that must acknowledge a write operation before the operation returns as successful. A member can only acknowledge a write operation after it has received and applied the write successfully. </p> <p class="leafygreen-ui-1kp3ins"> For replica sets: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A write concern of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> w: "majority" </code> </a> requires acknowledgment that the write operations have been durably committed to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-calculating-majority-count"> calculated majority </a> of the data-bearing voting members. For most replica set configurations, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> w: "majority" </code> </a> is the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-default-behavior"> default write concern <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A write concern of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-number-"> <code class="leafygreen-ui-1l06pbn"> w: 1 </code> </a> only requires acknowledgment from the primary replica set member before returning write concern acknowledgment. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A write concern with a numeric value greater than <code class="leafygreen-ui-1l06pbn"> 1 </code> requires acknowledgment from the primary and as many secondaries as needed to meet the specified value. The secondaries do not need to be voting members to meet the write concern threshold. The specified write concern value cannot be greater than the total number of data-bearing members in the replica set. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For complete documentation on write acknowledgment behavior, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-ack-behavior"> Acknowledgment Behavior <!-- --> . </a> </p> <div class="figure css-5vkxs0" style="width:520px"> <img alt='Write operation to a replica set with write concern level of ``w: "majority"`` or write to the primary and at least one secondary.' class="leafygreen-ui-1qnf57e" height="540" src="/docs/manual/images/crud-write-concern-w-majority.bakedsvg.svg" style="--border-color:#C1C7C6" width="520"/> </div> <p class="leafygreen-ui-1kp3ins"> An application that issues a write operation that requires write concern acknowledgment waits until the primary receives acknowledgment from the required number of members for the specified write concern. For write concern of <code class="leafygreen-ui-1l06pbn"> w </code> greater than 1 or <code class="leafygreen-ui-1l06pbn"> w : "majority" </code> , the primary waits until the required number of secondaries acknowledge the write before returning write concern acknowledgment. For write concern of <code class="leafygreen-ui-1l06pbn"> w: 1 </code> , the primary can return write concern acknowledgment as soon as it locally applies the write since it is eligible for contributing to the requested write concern. </p> <p class="leafygreen-ui-1kp3ins"> The more members that acknowledge a write, the less likely the written data could roll back if the <a class="leafygreen-ui-tqgtui" href="/docs/manual/replication/#std-label-replication-auto-failover"> primary fails </a> . However, specifying a high write concern can increase latency as the client must wait until it receives the requested level of write concern acknowledgment. </p> <p class="leafygreen-ui-1kp3ins"> Selecting the ideal write concern for any given write operation depends on your application's performance goals and data durability requirements. For more guidance on configuring write concern to prevent rollbacks, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-rollbacks/#std-label-rollback-avoid"> Avoid Replica Set Rollbacks <!-- --> . </a> </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Verify Write Operations to Replica Sets <a class="headerlink leafygreen-ui-1kepx47" href="#verify-write-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="verify-write-operations-to-replica-sets"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following operation includes the <code class="leafygreen-ui-1l06pbn"> writeConcern </code> option for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.insertOne/#mongodb-method-db.collection.insertOne"> <code class="leafygreen-ui-1l06pbn"> insertOne() </code> </a> method. The operation specifies: - the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> write concern, and - a 5 second timeout. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-wtimeout"> <code class="leafygreen-ui-1l06pbn"> wtimeout </code> </a> write concern parameter ensures that the operation does not block indefinitely. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products.insertOne(\n { item: \"envelopes\", qty : 100, type: \"Clasp\" },\n { writeConcern: { w: \"majority\" , wtimeout: 5000 } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"envelopes"</span>, <!-- -->qty <!-- -->: <span class="lg-highlight-number">100</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Clasp"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">writeConcern</span>: <!-- -->{ <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-string">"majority"</span> <!-- -->, <span class="lg-highlight-attr">wtimeout</span>: <span class="lg-highlight-number">5000</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The application waits until the primary returns write concern acknowledgment, indicating that a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-calculating-majority-count"> calculated majority </a> of the data-bearing voting members acknowledged the write operation. For example, in a 3-member replica set (P-S-S), the operation would require acknowledgment from 2 out of the 3 members. If the replica set was later scaled to include two additional voting secondary members, the same operation would require acknowledgment from 3 out of the 5 replica set members. If the primary does not return write concern acknowledgment within the <code class="leafygreen-ui-1l06pbn"> wtimeout </code> limit, the write operation fails with a write concern error. </p> <p class="leafygreen-ui-1kp3ins"> A write operation that times out waiting for the specified write concern only indicates that the required number of replica set members did not acknowledge the write operation within the <code class="leafygreen-ui-1l06pbn"> wtimeout </code> time period. It does not necessarily indicate that the primary failed to apply the write. The data may exist on a subset of replica set nodes at the time of the write concern error, and can continue replicating until all nodes in the cluster have that data. Applications should take into account the potential availability of written data regardless of the state of write concern acknowledgment. </p> <p class="leafygreen-ui-1kp3ins"> The exact syntax for specifying write concern depends on the write operation. Refer to the documentation for the write operation for instructions on write concern support and syntax. For complete documentation on write concern, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern"> Write Concern <!-- --> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-repl-set-modify-default-write-concern"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Modify Default Write Concern <a class="headerlink leafygreen-ui-1kepx47" href="#modify-default-write-concern" 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="modify-default-write-concern"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can modify the default write concern for a replica set by issuing the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setDefaultRWConcern/#mongodb-dbcommand-dbcmd.setDefaultRWConcern"> <code class="leafygreen-ui-1l06pbn"> setDefaultRWConcern </code> </a> command. </p> <p class="leafygreen-ui-1kp3ins"> If you issue a write operation with a specific write concern, the write operation uses its own write concern instead of the default. </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/reference/write-concern/"> Write Concern </a> </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Custom Write Concerns <a class="headerlink leafygreen-ui-1kepx47" href="#custom-write-concerns" 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="custom-write-concerns"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-replica-set-tag-sets/#std-label-replica-set-configuration-tag-sets"> tag </a> the members of replica sets and use the resulting tag sets to create custom write concerns. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-replica-set-tag-sets/#std-label-replica-set-configuration-tag-sets"> Configure Replica Set Tag Sets </a> for information on configuring custom write concerns using tag sets. </p> </section> </section>
https://www.mongodb.com/docs/manual/data-modeling/design-antipatterns/reduce-collections/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Reduce the Number of Collections <a class="headerlink leafygreen-ui-1kepx47" href="#reduce-the-number-of-collections" 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="reduce-the-number-of-collections"> </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="#about-this-task" target="_self"> <span> About this Task </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </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> <p class="leafygreen-ui-1kp3ins"> Creating too many collections can decrease performance. With every collection, MongoDB creates a default <a class="leafygreen-ui-tqgtui" href="/docs/manual/indexes/#std-label-indexes"> _id index </a> , which uses additional storage. If you create excessive collections, those collections and indexes can strain replica set resources and decrease performance. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> About this Task <a class="headerlink leafygreen-ui-1kepx47" href="#about-this-task" 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="about-this-task"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Consider the following schema that stores daily temperature readings that are taken every hour. The <code class="leafygreen-ui-1l06pbn"> temperature </code> database stores each day's readings in separate collections. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"// Temperatures for May 10, 2024\n{\n _id: 1,\n timestamp: \"2024-05-10T010:00:00Z\",\n temperature: 60\n},\n{\n _id: 2\n timestamp: \"2024-05-10T011:00:00Z\",\n temperature: 61\n},\n{\n _id: 3\n timestamp: \"2024-05-10T012:00:00Z\",\n temperature: 64\n}\n...","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">//</span><span class="lg-highlight-comment"> Temperatures for May </span><span class="lg-highlight-comment">10, 2024</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-string">"2024-05-10T010:00:00Z"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temperature</span>: <span class="lg-highlight-number">60</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-string">"2024-05-10T011:00:00Z"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temperature</span>: <span class="lg-highlight-number">61</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-string">"2024-05-10T012:00:00Z"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temperature</span>: <span class="lg-highlight-number">64</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">...</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"// Temperatures for May 11, 2024\n{\n _id: 1,\n timestamp: \"2024-05-11T010:00:00Z\",\n temperature: 68\n},\n{\n _id: 2\n timestamp: \"2024-05-11T011:00:00Z\",\n temperature: 72\n},\n{\n _id: 3\n timestamp: \"2024-05-11T012:00:00Z\",\n temperature: 72\n}\n...","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">//</span><span class="lg-highlight-comment"> Temperatures for May </span><span class="lg-highlight-comment">11, 2024</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-string">"2024-05-11T010:00:00Z"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temperature</span>: <span class="lg-highlight-number">68</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-string">"2024-05-11T011:00:00Z"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temperature</span>: <span class="lg-highlight-number">72</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-string">"2024-05-11T012:00:00Z"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temperature</span>: <span class="lg-highlight-number">72</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">...</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> With an unbound number of collections, the number of default <code class="leafygreen-ui-1l06pbn"> _id </code> indexes can grow to degrade performance. </p> <p class="leafygreen-ui-1kp3ins"> Additionally, this approach requires a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/lookup/#mongodb-pipeline-pipe.-lookup"> <code class="leafygreen-ui-1l06pbn"> $lookup </code> </a> operation to query across multiple collections. <code class="leafygreen-ui-1l06pbn"> $lookup </code> operations add query complexity and can strain resources. </p> <p class="leafygreen-ui-1kp3ins"> To reduce the number of collections, drop or archive unused collections, or remodel your data schema by consolidating related collections, denormalizing data, or leveraging embedded documents where appropriate. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can modify the schema to store each day's temperature readings in a single collection. For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.dailyTemperatures.insertMany( [\n {\n _id: ISODate(\"2024-05-10T00:00:00Z\"),\n readings: [\n {\n timestamp: \"2024-05-10T10:00:00Z\",\n temperature: 60\n },\n {\n timestamp: \"2024-05-10T11:00:00Z\",\n temperature: 61\n },\n {\n timestamp: \"2024-05-10T12:00:00Z\",\n temperature: 64\n }\n ]\n },\n {\n _id: ISODate(\"2024-05-11T00:00:00Z\"),\n readings: [\n {\n timestamp: \"2024-05-11T10:00:00Z\",\n temperature: 68\n },\n {\n timestamp: \"2024-05-11T11:00:00Z\",\n temperature: 72\n },\n {\n timestamp: \"2024-05-11T12:00:00Z\",\n temperature: 72\n }\n ]\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">dailyTemperatures</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2024-05-10T00:00:00Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">readings</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-string">"2024-05-10T10:00:00Z"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temperature</span>: <span class="lg-highlight-number">60</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-string">"2024-05-10T11:00:00Z"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temperature</span>: <span class="lg-highlight-number">61</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-string">"2024-05-10T12:00:00Z"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temperature</span>: <span class="lg-highlight-number">64</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2024-05-11T00:00:00Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">readings</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-string">"2024-05-11T10:00:00Z"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temperature</span>: <span class="lg-highlight-number">68</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-string">"2024-05-11T11:00:00Z"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temperature</span>: <span class="lg-highlight-number">72</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timestamp</span>: <span class="lg-highlight-string">"2024-05-11T12:00:00Z"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temperature</span>: <span class="lg-highlight-number">72</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The updated schema requires fewer resources than the original. Instead of needing a separate index for each day, the default <code class="leafygreen-ui-1l06pbn"> _id </code> index now facilitates queries by date. </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> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/design-antipatterns/#std-label-schema-design-antipatterns"> Schema Design Anti-Patterns </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/design-patterns/#std-label-schema-design-patterns"> Schema Design Patterns </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/release-notes/7.0-upgrade/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Upgrade <!-- --> 6.0 <!-- --> to <!-- --> 7.0 <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-oldversion-to-newversion" 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="upgrade-oldversion-to-newversion"> </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="#upgrade-path" target="_self"> <span> Upgrade Path </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#procedures" target="_self"> <span> Procedures </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> This page lists procedures used to upgrade from <!-- --> 6.0 <!-- --> to <!-- --> 7.0 <!-- --> . </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Upgrade Path <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-path" 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="upgrade-path"> </div> </a> </h2> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Before you upgrade or downgrade a replica set, ensure all replica set members are running. If you do not, the upgrade or downgrade will not complete until all members are started. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> If you need to downgrade from <!-- --> 7.0 <!-- --> , downgrade to the latest patch release of <!-- --> 6.0 <!-- --> . </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedures <a class="headerlink leafygreen-ui-1kepx47" href="#procedures" 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="procedures"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/7.0-upgrade-standalone/#std-label-7.0-upgrade-standalone"> Upgrade a Standalone to 7.0 <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/7.0-upgrade-replica-set/#std-label-7.0-upgrade-replica-set"> Upgrade a Replica Set to 7.0 <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/7.0-upgrade-sharded-cluster/#std-label-7.0-upgrade-sharded-cluster"> Upgrade a Sharded Cluster to 7.0 <!-- --> . </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/core/queryable-encryption/install/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Install a Queryable Encryption Compatible Driver <a class="headerlink leafygreen-ui-1kepx47" href="#install-a-queryable-encryption-compatible-driver" 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="install-a-queryable-encryption-compatible-driver"> </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="#procedure" target="_self"> <span> Procedure </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#install-a-queryable-encryption-compatible-driver-1" target="_self"> <span> Install a Queryable Encryption compatible driver </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#install-driver-dependencies" target="_self"> <span> Install driver dependencies </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#start-a-mongodb-atlas-cluster-or-enterprise-instance." target="_self"> <span> Start a MongoDB Atlas Cluster or Enterprise instance. </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#next-steps" target="_self"> <span> Next Steps </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"> To enable Queryable Encryption in your development environment, you must first install a compatible driver and dependencies. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-qe-quick-start-driver-dependencies"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#procedure" 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="procedure"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Install a MongoDB Driver Compatible with Queryable Encryption.","name":"Install a Queryable Encryption compatible driver"},{"@type":"HowToStep","text":"See the Drivers compatibility table for a list of\ndependencies for your driver.","name":"Install driver dependencies"},{"@type":"HowToStep","text":"Start an Atlas Cluster or a\nMongoDB Enterprise instance.","name":"Start a MongoDB Atlas Cluster or Enterprise instance."}],"name":"Procedure","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-qum8nr eccljxs0"> <div class="css-vq8pj5 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-18jxsvu e1ckbxcu2"> 1 </div> </div> <div class="css-clrhqf"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Install a Queryable Encryption compatible driver <a class="headerlink leafygreen-ui-1kepx47" href="#install-a-queryable-encryption-compatible-driver-1" 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="install-a-queryable-encryption-compatible-driver-1"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Install a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/compatibility/#std-label-qe-driver-compatibility"> MongoDB Driver Compatible with Queryable Encryption <!-- --> . </a> </p> </section> </div> </div> <div class="css-vq8pj5 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-18jxsvu e1ckbxcu2"> 2 </div> </div> <div class="css-clrhqf"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Install driver dependencies <a class="headerlink leafygreen-ui-1kepx47" href="#install-driver-dependencies" 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="install-driver-dependencies"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> See the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/compatibility/#std-label-qe-driver-compatibility"> Drivers compatibility table </a> for a list of dependencies for your driver. </p> </section> </div> </div> <div class="css-vq8pj5 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-18jxsvu e1ckbxcu2"> 3 </div> </div> <div class="css-clrhqf"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Start a MongoDB Atlas Cluster or Enterprise instance. <a class="headerlink leafygreen-ui-1kepx47" href="#start-a-mongodb-atlas-cluster-or-enterprise-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="start-a-mongodb-atlas-cluster-or-enterprise-instance."> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Start an <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/getting-started/?jmp=docs" target="_self"> <span> Atlas Cluster </span> </a> or a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/manual/tutorial/manage-mongodb-processes/#start-mongod-processes" target="_self"> <span> MongoDB Enterprise instance <!-- --> . </span> </a> </p> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Next Steps <a class="headerlink leafygreen-ui-1kepx47" href="#next-steps" 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="next-steps"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Once you have installed a compatible driver and dependencies, <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/install-library/#std-label-qe-csfle-install-library"> install and configure a Queryable Encryption library </a> to continue setting up your deployment and development environment. </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/toUUID/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $toUUID (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-touuid--aggregation-" 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="-touuid--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <div> <p> <em> New <!-- --> in version <!-- --> 8.0 </em> . </p> </div> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $toUUID </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-toUUID" 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-expression-exp.-toUUID"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Converts a string value to a <span class="leafygreen-ui-vm4wms" tabindex="0"> UUID </span> . If the input value is not a string, <code class="leafygreen-ui-1l06pbn"> $toUUID </code> errors. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n $toUUID: &lt;expression&gt;\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$toUUID</span>: &lt;<!-- -->expression<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> $toUUID </code> expression is shorthand for the following <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/convert/#mongodb-expression-exp.-convert"> <code class="leafygreen-ui-1l06pbn"> $convert </code> </a> expression: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n $convert: {\n input: &lt;expression&gt;,\n to: {\n type: \"binData\",\n subtype: 4 // UUID\n },\n format: \"uuid\"\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$convert</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">input</span>: &lt;<!-- -->expression<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">to</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"binData"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">subtype</span>: <span class="lg-highlight-number">4</span> <span class="lg-highlight-comment">// UUID</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">format</span>: <span class="lg-highlight-string">"uuid"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Create a <code class="leafygreen-ui-1l06pbn"> products </code> collection with the following document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products.insertOne(\n {\n name: \"laptop\",\n price: 400,\n UUID: \"0e3b9063-8abd-4eb3-9f9f-f4c59fd30a60\"\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">"laptop"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">400</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">UUID</span>: <span class="lg-highlight-string">"0e3b9063-8abd-4eb3-9f9f-f4c59fd30a60"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example document, the <code class="leafygreen-ui-1l06pbn"> UUID </code> field is a string. To convert the <code class="leafygreen-ui-1l06pbn"> UUID </code> field to a UUID value, run the following <code class="leafygreen-ui-1l06pbn"> $toUUID </code> operation: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products.aggregate( [\n {\n $project: {\n name: 1,\n price: 1,\n UUID: {\n $toUUID: \"$UUID\"\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">UUID</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$toUUID</span>: <span class="lg-highlight-string">"$UUID"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n {\n _id: ObjectId('669945ab610b080391a8e2f5'),\n name: 'laptop',\n price: 400,\n UUID: UUID('0e3b9063-8abd-4eb3-9f9f-f4c59fd30a60')\n }\n]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">'669945ab610b080391a8e2f5'</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">'laptop'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">400</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">UUID</span>: <span class="lg-highlight-title lg-highlight-function">UUID</span>(<span class="lg-highlight-string">'0e3b9063-8abd-4eb3-9f9f-f4c59fd30a60'</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/KeyVault.removeKeyAlternateName/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> KeyVault.removeKeyAlternateName() <a class="headerlink leafygreen-ui-1kepx47" href="#keyvault.removekeyalternatename--" 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="keyvault.removekeyalternatename--"> </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="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> KeyVault.removeKeyAlternateName(UUID, keyAltName) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-KeyVault.removeKeyAlternateName" 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-method-KeyVault.removeKeyAlternateName"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Removes the specified <code class="leafygreen-ui-1l06pbn"> keyAltName </code> from the data encryption key with the specified <code class="leafygreen-ui-1l06pbn"> UUID </code> . The data encryption key must exist in the key vault associated to the database connection. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-KeyVault.removeKeyAlternateName" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> removeKeyAlternateName() </code> </span> </a> has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"keyVault = db.getMongo().getKeyVault()\n\nkeyVault.removeKeyAlternateName(\n UUID(\"&lt;uuid&gt;\"),\n \"keyAltName\"\n)"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">keyVault = db.getMongo().getKeyVault()</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">keyVault.removeKeyAlternateName(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> UUID("&lt;UUID string&gt;"),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "keyAltName"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <table class="css-11h39yh e1nex8bq0"> <colgroup> <col class="field-name"/> <col class="field-body"/> </colgroup> <tbody> <tr class="css-x8snli"> <th> Returns <!-- --> : </th> <td> The data encryption key <em> prior </em> to updating the <code class="leafygreen-ui-1l06pbn"> keyAltName </code> . <p class="leafygreen-ui-1kp3ins"> Returns <code class="leafygreen-ui-1l06pbn"> null </code> if no data encryption key has the specified <code class="leafygreen-ui-1l06pbn"> UUID() </code> . </p> </td> </tr> </tbody> </table> </dd> </dl> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Requires Configuring Client-Side Field Level Encryption on Database Connection <a class="headerlink leafygreen-ui-1kepx47" href="#requires-configuring-client-side-field-level-encryption-on-database-connection" 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="requires-configuring-client-side-field-level-encryption-on-database-connection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> client-side field level encryption methods require a database connection with client-side field level encryption enabled. If the current database connection was not initiated with client-side field level encryption enabled, either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> constructor from the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to establish a connection with the required client-side field level encryption options. The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> method supports the following Key Management Service (KMS) providers for Customer Master Key (CMK) management: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-aws"> Amazon Web Services KMS </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-azure"> Azure Key Vault </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-gcp"> Google Cloud Platform KMS </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-local"> Locally Managed Key </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <em> or </em> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-label-mongosh-client-side-field-level-encryption-options" target="_self"> <span> command line options </span> </a> to establish a connection with the required options. The command line options only support the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-aws"> Amazon Web Services KMS </a> provider for CMK management. </p> </li> </ul> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example is intended for rapid evaluation of client-side field level encryption. For specific examples of using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-KeyVault.removeKeyAlternateName" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> KeyVault.removeKeyAlternateName() </code> </span> </a> with each supported <span class="leafygreen-ui-vm4wms" tabindex="0"> KMS </span> provider, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/fundamentals/manage-keys/#std-label-field-level-encryption-data-key-manage"> Encryption Key Management <!-- --> . </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Start the mongosh client.","name":"Start mongosh"},{"@type":"HowToStep","text":"To configure client-side field level encryption for a locally\nmanaged key, generate a base64-encoded 96-byte string with no line\nbreaks.","name":"Generate Your Key"},{"@type":"HowToStep","text":"Create the client-side field level encryption options using the\ngenerated local key string:","name":"Create the Client-Side Field Level Encryption Options"},{"@type":"HowToStep","text":"Use the Mongo() constructor with the client-side field level\nencryption options configured to create a database connection. Replace\nthe mongodb://myMongo.example.net URI with the connection\nstring URI of the target cluster.","name":"Create Your Encrypted Client"}],"name":"Example","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Start mongosh <a class="headerlink leafygreen-ui-1kepx47" href="#start-mongosh" 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="start-mongosh"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Start the <code class="leafygreen-ui-1l06pbn"> mongosh </code> client. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh --nodb","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">mongosh --nodb</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Generate Your Key <a class="headerlink leafygreen-ui-1kepx47" href="#generate-your-key" 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="generate-your-key"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To configure client-side field level encryption for a locally managed key, generate a base64-encoded 96-byte string with no line breaks. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"const TEST_LOCAL_KEY = require(\"crypto\").randomBytes(96).toString(\"base64\")","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"><span class="lg-highlight-keyword">const</span> <span class="lg-highlight-variable lg-highlight-constant">TEST_LOCAL_KEY</span> <!-- -->= <span class="lg-highlight-built_in">require</span>(<span class="lg-highlight-string">"crypto"</span>).<span class="lg-highlight-title lg-highlight-function">randomBytes</span>(<span class="lg-highlight-number">96</span>).<span class="lg-highlight-title lg-highlight-function">toString</span>(<span class="lg-highlight-string">"base64"</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> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create the Client-Side Field Level Encryption Options <a class="headerlink leafygreen-ui-1kepx47" href="#create-the-client-side-field-level-encryption-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-the-client-side-field-level-encryption-options"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Create the client-side field level encryption options using the generated local key string: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":" var autoEncryptionOpts = {\n \"keyVaultNamespace\" : \"encryption.__dataKeys\",\n \"kmsProviders\" : {\n \"local\" : {\n \"key\" : BinData(0, TEST_LOCAL_KEY)\n }\n }\n }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">var</span> autoEncryptionOpts <!-- -->= <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keyVaultNamespace"</span> <!-- -->: <span class="lg-highlight-string">"encryption.__dataKeys"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"kmsProviders"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"local"</span> <!-- -->: <!-- -->{</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"key"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">BinData</span>(<span class="lg-highlight-number">0</span>, <span class="lg-highlight-variable lg-highlight-constant">TEST_LOCAL_KEY</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create Your Encrypted Client <a class="headerlink leafygreen-ui-1kepx47" href="#create-your-encrypted-client" 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-your-encrypted-client"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> constructor with the client-side field level encryption options configured to create a database connection. Replace the <code class="leafygreen-ui-1l06pbn"> mongodb://myMongo.example.net </code> URI with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string/#std-label-mongodb-uri"> connection string URI </a> of the target cluster. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"encryptedClient = Mongo(\n \"mongodb://myMongo.example.net:27017/?replSetName=myMongo\",\n autoEncryptionOpts\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">encryptedClient <!-- -->= <span class="lg-highlight-title lg-highlight-class">Mongo</span>(</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"mongodb://myMongo.example.net:27017/?replSetName=myMongo"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->autoEncryptionOpts</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Retrieve the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/getKeyVault/#mongodb-method-getKeyVault"> <code class="leafygreen-ui-1l06pbn"> keyVault </code> </a> object and use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-KeyVault.removeKeyAlternateName" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> KeyVault.removeKeyAlternateName() </code> </span> </a> method to remove the specified key alternate name from the data encryption key with matching <code class="leafygreen-ui-1l06pbn"> UUID </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"keyVault = encryptedClient.getKeyVault()\nkeyVault.removeKeyAlternateName(UUID(\"b4b41b33-5c97-412e-a02b-743498346079\"),\"Other-Data-Encryption-Key\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">keyVault <!-- -->= <!-- -->encryptedClient.<span class="lg-highlight-title lg-highlight-function">getKeyVault</span>(<!-- -->)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">keyVault.<span class="lg-highlight-title lg-highlight-function">removeKeyAlternateName</span>(<span class="lg-highlight-title lg-highlight-function">UUID</span>(<span class="lg-highlight-string">"b4b41b33-5c97-412e-a02b-743498346079"</span>)<!-- -->,<span class="lg-highlight-string">"Other-Data-Encryption-Key"</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"> If successful, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-KeyVault.removeKeyAlternateName" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> removeKeyAlternateName() </code> </span> </a> returns the data encryption key <em> prior </em> to updating the <code class="leafygreen-ui-1l06pbn"> keyAltName </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : UUID(\"b4b41b33-5c97-412e-a02b-743498346079\"),\n \"keyMaterial\" : BinData(0,\"PXRsLOAYxhzTS/mFQAI8486da7BwZgqA91UI7NKz/T/AjB0uJZxTvhvmQQsKbCJYsWVS/cp5Rqy/FUX2zZwxJOJmI3rosPhzV0OI5y1cuXhAlLWlj03CnTcOSRzE/YIrsCjMB0/NyiZ7MRWUYzLAEQnE30d947XCiiHIb8a0kt2SD0so8vZvSuP2n0Vtz4NYqnzF0CkhZSWFa2e2yA==\"),\n \"creationDate\" : ISODate(\"2019-08-12T21:21:30.569Z\"),\n \"updateDate\" : ISODate(\"2019-08-12T21:21:30.569Z\"),\n \"status\" : 0,\n \"version\" : NumberLong(0),\n \"masterKey\" : {\n \"provider\" : \"local\"\n },\n \"keyAltNames\" : [\n \"ssn-encryption-key\"\n ]\n}","programmingLanguage":"JSON"} </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 json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"_id"</span> <span class="lg-highlight-punctuation">:</span> UUID(<span class="lg-highlight-string">"b4b41b33-5c97-412e-a02b-743498346079"</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"keyMaterial"</span> <span class="lg-highlight-punctuation">:</span> BinData(<span class="lg-highlight-number">0</span><span class="lg-highlight-punctuation">,</span><span class="lg-highlight-string">"PXRsLOAYxhzTS/mFQAI8486da7BwZgqA91UI7NKz/T/AjB0uJZxTvhvmQQsKbCJYsWVS/cp5Rqy/FUX2zZwxJOJmI3rosPhzV0OI5y1cuXhAlLWlj03CnTcOSRzE/YIrsCjMB0/NyiZ7MRWUYzLAEQnE30d947XCiiHIb8a0kt2SD0so8vZvSuP2n0Vtz4NYqnzF0CkhZSWFa2e2yA=="</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"creationDate"</span> <span class="lg-highlight-punctuation">:</span> ISODate(<span class="lg-highlight-string">"2019-08-12T21:21:30.569Z"</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"updateDate"</span> <span class="lg-highlight-punctuation">:</span> ISODate(<span class="lg-highlight-string">"2019-08-12T21:21:30.569Z"</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"status"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">0</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"version"</span> <span class="lg-highlight-punctuation">:</span> NumberLong(<span class="lg-highlight-number">0</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"masterKey"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"provider"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"local"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"keyAltNames"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ssn-encryption-key"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">]</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</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> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/add-replica-set-arbiter/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Add an Arbiter to a Self-Managed Replica Set <a class="headerlink leafygreen-ui-1kepx47" href="#add-an-arbiter-to-a-self-managed-replica-set" 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="add-an-arbiter-to-a-self-managed-replica-set"> </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="#considerations" target="_self"> <span> Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#primary-secondary-arbiter-replica-sets" target="_self"> <span> Primary-Secondary-Arbiter Replica Sets </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#add-an-arbiter" target="_self"> <span> Add an Arbiter </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> In some circumstances (such as you have a primary and a secondary but cost constraints prohibit adding another secondary), you may choose to add a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance to a replica set as an <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-arbiter/#std-label-replica-set-arbiter-configuration"> arbiter </a> to vote in elections. </p> <p class="leafygreen-ui-1kp3ins"> Arbiters are <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances that are part of a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> but do not hold data (i.e. do not provide data redundancy). They can, however, participate in <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-elections/#std-label-replica-set-elections"> elections <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Arbiters have minimal resource requirements and do not require dedicated hardware. You can deploy an arbiter on an application server or a monitoring host. </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"> Do not run an arbiter on systems that also host the primary or the secondary members of the replica set. </p> </div> </div> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Avoid deploying more than one <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-arbiter"> arbiter </a> in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> . See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-arbiter/#std-label-rollbacks-multi-arbiters"> Concerns with Multiple Arbiters <!-- --> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> To add an arbiter to an existing replica set: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Typically, if there are two or fewer data-bearing members in the replica set, you might need to first set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setDefaultRWConcern/#std-label-set_global_default_write_concern"> cluster wide write concern </a> for the replica set. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setDefaultRWConcern/#std-label-set_global_default_write_concern"> cluster wide write concern </a> for more information on why you might need to set the cluster wide write concern. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> You do not need to change the cluster wide write concern before starting a new replica set with an arbiter. </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/reference/mongodb-defaults/#std-label-default-wc-formula"> Default write concern formula </a> </p> </div> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#considerations" 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="considerations"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-members/#std-label-replica-set-arbiters"> Arbiters </a> are not supported with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/versioning/#std-label-release-version-numbers"> quarterly rapid releases </a> . If your deployment includes arbiters, only use <span class="leafygreen-ui-vm4wms" tabindex="0"> LTS </span> releases. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Primary-Secondary-Arbiter Replica Sets <a class="headerlink leafygreen-ui-1kepx47" href="#primary-secondary-arbiter-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="primary-secondary-arbiter-replica-sets"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If you are using a three-member primary-secondary-arbiter (PSA) architecture, consider the following: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The write concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> can cause performance issues if a secondary is unavailable or lagging. For advice on how to mitigate these issues, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/mitigate-psa-performance-issues/#std-label-performance-issues-psa"> Mitigate Performance Issues with a Self-Managed PSA Replica Set <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you are using a global default <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> and the write concern is less than the size of the majority, your queries may return stale (not fully replicated) data. </p> </li> </ul> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Arbiter <a class="headerlink leafygreen-ui-1kepx47" href="#arbiter" 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="arbiter"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> An arbiter does not store data, but until the arbiter's <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process is added to the replica set, the arbiter will act like any other <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process and start up with a set of data files and with a full-sized <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-journal"> journal <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> IP Binding <a class="headerlink leafygreen-ui-1kepx47" href="#ip-binding" 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="ip-binding"> </div> </a> </h3> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Before you bind your instance to a publicly-accessible IP address, you must secure your cluster from unauthorized access. For a complete list of security recommendations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-security-checklist"> Security Checklist for Self-Managed Deployments </a> . At minimum, consider <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-checklist-auth"> enabling authentication </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-hardening/#std-label-network-config-hardening"> hardening network infrastructure <!-- --> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB binaries, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , bind to localhost by default. If the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.ipv6"> <code class="leafygreen-ui-1l06pbn"> net.ipv6 </code> </a> configuration file setting or the <code class="leafygreen-ui-1l06pbn"> --ipv6 </code> command line option is set for the binary, the binary additionally binds to the localhost IPv6 address. </p> <p class="leafygreen-ui-1kp3ins"> By default <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> that are bound to localhost only accept connections from clients that are running on the same computer. This binding behavior includes <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 other members of your replica set or sharded cluster. Remote clients cannot connect to binaries that are bound only to localhost. </p> <p class="leafygreen-ui-1kp3ins"> To override the default binding and bind to other IP addresses, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> configuration file setting or the <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> command-line option to specify a list of hostnames or IP addresses. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Starting in MongDB 5.0, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/Split-horizon_DNS" rel="noopener noreferrer"> <span> split horizon DNS </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> nodes that are only configured with an IP address fail startup validation and report an error. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.disableSplitHorizonIPCheck"> <code class="leafygreen-ui-1l06pbn"> disableSplitHorizonIPCheck </code> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For example, the following <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance binds to both the localhost and the hostname <code class="leafygreen-ui-1l06pbn"> My-Example-Associated-Hostname </code> , which is associated with the IP address <code class="leafygreen-ui-1l06pbn"> 198.51.100.1 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --bind_ip localhost,My-Example-Associated-Hostname"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --bind_ip localhost,My-Example-Associated-Hostname</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"> In order to connect to this instance, remote clients must specify the hostname or its associated IP address <code class="leafygreen-ui-1l06pbn"> 198.51.100.1 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh --host My-Example-Associated-Hostname\n\nmongosh --host 198.51.100.1"} </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">mongosh --host My-Example-Associated-Hostname</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongosh --host 198.51.100.1</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"> To avoid configuration updates due to IP address changes, use DNS hostnames instead of IP addresses. It is particularly important to use a DNS hostname instead of an IP address when configuring replica set members or sharded cluster members. </p> <p class="leafygreen-ui-1kp3ins"> Use hostnames instead of IP addresses to configure clusters across a split network horizon. Starting in MongoDB 5.0, nodes that are only configured with an IP address fail startup validation and do not start. </p> </div> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Add an Arbiter <a class="headerlink leafygreen-ui-1kepx47" href="#add-an-arbiter" 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="add-an-arbiter"> </div> </a> </h2> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Avoid deploying more than one <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-arbiter"> arbiter </a> in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> . See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-arbiter/#std-label-rollbacks-multi-arbiters"> Concerns with Multiple Arbiters <!-- --> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> To add an arbiter to an existing replica set: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Typically, if there are two or fewer data-bearing members in the replica set, you might need to first set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setDefaultRWConcern/#std-label-set_global_default_write_concern"> cluster wide write concern </a> for the replica set. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setDefaultRWConcern/#std-label-set_global_default_write_concern"> cluster wide write concern </a> for more information on why you might need to set the cluster wide write concern. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> You do not need to change the cluster wide write concern before starting a new replica set with an arbiter. </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/reference/mongodb-defaults/#std-label-default-wc-formula"> Default write concern formula </a> </p> </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"> To avoid configuration updates due to IP address changes, use DNS hostnames instead of IP addresses. It is particularly important to use a DNS hostname instead of an IP address when configuring replica set members or sharded cluster members. </p> <p class="leafygreen-ui-1kp3ins"> Use hostnames instead of IP addresses to configure clusters across a split network horizon. Starting in MongoDB 5.0, nodes that are only configured with an IP address fail startup validation and do not start. </p> </div> </div> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create a data directory (e.g. <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> storage.dbPath </code> </a> ) for the arbiter. The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance uses the directory for configuration data. The directory <em> will not </em> hold the data set. For example, create the <code class="leafygreen-ui-1l06pbn"> /var/lib/mongodb/arb </code> directory: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mkdir /var/lib/mongodb/arb","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"><span class="lg-highlight-built_in">mkdir</span> <!-- -->/var/lib/mongodb/arb</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Start the arbiter, specifying the data directory and the name of the replica set to join. The following starts an arbiter using the <code class="leafygreen-ui-1l06pbn"> /var/lib/mongodb/arb </code> as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> dbPath </code> </a> and <code class="leafygreen-ui-1l06pbn"> rs </code> for the replica set name: </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Before you bind your instance to a publicly-accessible IP address, you must secure your cluster from unauthorized access. For a complete list of security recommendations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-security-checklist"> Security Checklist for Self-Managed Deployments </a> . At minimum, consider <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-checklist-auth"> enabling authentication </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-hardening/#std-label-network-config-hardening"> hardening network infrastructure <!-- --> . </a> </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --port 27017 --dbpath /var/lib/mongodb/arb --replSet rs --bind_ip localhost,&lt;hostname(s)|ip&gt;","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">mongod --port 27017 --dbpath <!-- -->/var/lib/mongodb/arb<!-- --> --replSet rs --bind_ip localhost,&lt;hostname(s)|ip address(es)&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Connect to the primary and add the arbiter to the replica set. Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.addArb/#mongodb-method-rs.addArb"> <code class="leafygreen-ui-1l06pbn"> rs.addArb() </code> </a> method, as in the following example which assumes that <code class="leafygreen-ui-1l06pbn"> m1.example.net </code> is the hostname associated with the specified ip address for the arbiter: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"rs.addArb(\"m1.example.net:27017\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">addArb</span>(<span class="lg-highlight-string">"m1.example.net:27017"</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"> This operation adds the arbiter running on port <code class="leafygreen-ui-1l06pbn"> 27017 </code> on the <code class="leafygreen-ui-1l06pbn"> m1.example.net </code> host. </p> </li> </ol> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/db.printReplicationInfo/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.printReplicationInfo() <a class="headerlink leafygreen-ui-1kepx47" href="#db.printreplicationinfo--" 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.printreplicationinfo--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.printReplicationInfo() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.printReplicationInfo" 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-method-db.printReplicationInfo"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Prints a formatted report of the replica set member's <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> . The displayed report formats the data returned by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getReplicationInfo/#mongodb-method-db.getReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> db.getReplicationInfo() </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The output of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.printReplicationInfo" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.printReplicationInfo() </code> </span> </a> is identical to that of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.printReplicationInfo/#mongodb-method-rs.printReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> rs.printReplicationInfo() </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"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.printReplicationInfo" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.printReplicationInfo() </code> </span> </a> method run 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> does <strong> not </strong> return <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-JSON"> JSON </a> . Use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.printReplicationInfo" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.printReplicationInfo() </code> </span> </a> for manual inspection, and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getReplicationInfo/#mongodb-method-db.getReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> db.getReplicationInfo() </code> </a> in scripts. </p> </div> </div> </dd> </dl> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Output Example <a class="headerlink leafygreen-ui-1kepx47" href="#output-example" 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-example"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example is a sample output from the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.printReplicationInfo" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.printReplicationInfo() </code> </span> </a> method run on the primary: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"configured oplog size: 192MB\nlog length start to end: 65422secs (18.17hrs)\noplog first event time: Mon Jun 23 2014 17:47:18 GMT-0400 (EDT)\noplog last event time: Tue Jun 24 2014 11:57:40 GMT-0400 (EDT)\nnow: Thu Jun 26 2014 14:24:39 GMT-0400 (EDT)"} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">configured oplog size: 192MB</td></tr><tr class=""><td class="leafygreen-ui-7razhx">log length start to end: 65422secs (18.17hrs)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">oplog first event time: Mon Jun 23 2014 17:47:18 GMT-0400 (EDT)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">oplog last event time: Tue Jun 24 2014 11:57:40 GMT-0400 (EDT)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">now: Thu Jun 26 2014 14:24:39 GMT-0400 (EDT)</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> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Output Fields <a class="headerlink leafygreen-ui-1kepx47" href="#output-fields" 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-fields"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.printReplicationInfo" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.printReplicationInfo() </code> </span> </a> formats and prints the data returned by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getReplicationInfo/#mongodb-method-db.getReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> db.getReplicationInfo() </code> : </a> </p> <dl> <dt> configured oplog size </dt> <dd class="css-1ufxuu7"> Displays the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getReplicationInfo/#mongodb-data-db.getReplicationInfo--.logSizeMB"> <code class="leafygreen-ui-1l06pbn"> db.getReplicationInfo().logSizeMB </code> </a> value. </dd> <dt> log length start to end </dt> <dd class="css-1ufxuu7"> Displays the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getReplicationInfo/#mongodb-data-db.getReplicationInfo--.timeDiff"> <code class="leafygreen-ui-1l06pbn"> db.getReplicationInfo().timeDiff </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getReplicationInfo/#mongodb-data-db.getReplicationInfo--.timeDiffHours"> <code class="leafygreen-ui-1l06pbn"> db.getReplicationInfo().timeDiffHours </code> </a> values. </dd> <dt> oplog first event time </dt> <dd class="css-1ufxuu7"> Displays the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getReplicationInfo/#mongodb-data-db.getReplicationInfo--.tFirst"> <code class="leafygreen-ui-1l06pbn"> db.getReplicationInfo().tFirst </code> . </a> </dd> <dt> oplog last event time </dt> <dd class="css-1ufxuu7"> Displays the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getReplicationInfo/#mongodb-data-db.getReplicationInfo--.tLast"> <code class="leafygreen-ui-1l06pbn"> db.getReplicationInfo().tLast </code> . </a> </dd> <dt> now </dt> <dd class="css-1ufxuu7"> Displays the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getReplicationInfo/#mongodb-data-db.getReplicationInfo--.now"> <code class="leafygreen-ui-1l06pbn"> db.getReplicationInfo().now </code> . </a> </dd> </dl> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getReplicationInfo/#mongodb-method-db.getReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> db.getReplicationInfo() </code> </a> for description of the data. </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/core/views/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Views <a class="headerlink leafygreen-ui-1kepx47" href="#views" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="views"> </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="#use-cases" target="_self"> <span> Use Cases </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#create-and-manage-views" target="_self"> <span> Create and Manage Views </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#comparison-with-on-demand-materialized-views" target="_self"> <span> Comparison with On-Demand Materialized Views </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#access-control" target="_self"> <span> Access Control </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> A MongoDB view is a read-only queryable object whose contents are defined by an <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/aggregation-pipeline/#std-label-aggregation-pipeline"> aggregation pipeline </a> on other collections or views. </p> <p class="leafygreen-ui-1kp3ins"> MongoDB does not persist the view contents to disk. A view's content is computed on-demand when a client queries the view. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Disambiguation </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page discusses standard views. For discussion of on-demand materialized views, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/materialized-views/#std-label-manual-materialized-views"> On-Demand Materialized Views. </a> </p> <p class="leafygreen-ui-1kp3ins"> To understand the differences between the view types, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-view-materialized-view-compare" target="_self"> <span> Comparison with On-Demand Materialized Views. </span> </a> </p> </div> </div> <a class="css-53dzkk" href="https://www.mongodb.com/docs/manual/core/materialized-views/#create-a-materialized-view-in-the-mongodb-atlas-ui"> <div class="css-z0l49d"> <div class="css-fw7ipj"> <svg aria-label="Cloud Icon" class="leafygreen-ui-1t2jgtk" fill="none" height="16" role="img" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path d="M12.571 8.143c0 1.775-.899 3.34-2.267 4.264l-.014.01a5.12 5.12 0 0 1-2.861.869H2.857a2.857 2.857 0 0 1-.545-5.663 5.144 5.144 0 0 1 10.26.52ZM13.821 8.143a6.38 6.38 0 0 1-2.358 4.96 3.429 3.429 0 1 0 2.17-6.506c.123.494.188 1.013.188 1.546Z" fill="currentColor"> </path> </svg> </div> <p class="leafygreen-ui-1kp3ins"> You can <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/materialized-views/#std-label-create-view-atlas"> create materialized views in the UI </a> for deployments hosted in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas. </span> </a> </p> </div> </a> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Use Cases <a class="headerlink leafygreen-ui-1kepx47" href="#use-cases" 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-cases"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can use views to: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create a view on a collection of employee data to exclude any personally identifiable information (PII). Your application can query the view for employee data that does not contain any <span class="leafygreen-ui-vm4wms" tabindex="0"> PII </span> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create a view on a collection of sensor data to add computed fields and metrics. Your application can use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find operations </code> </a> to query the computed data. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create a view that joins two collections containing inventory and order history. Your application can query the view without managing or understanding the underlying pipeline. </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Create and Manage Views <a class="headerlink leafygreen-ui-1kepx47" href="#create-and-manage-views" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-and-manage-views"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To learn how to create and manage views, see the following resources: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/materialized-views/#std-label-create-view-atlas"> Create a Materialized View in the MongoDB Atlas UI </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/create-view/#std-label-manual-views-create"> Create and Query a View </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/join-collections-with-view/#std-label-manual-views-lookup"> Use a View to Join Two Collections </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/specify-collation/#std-label-manual-views-collation"> Create a View with Default Collation </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/update-view/#std-label-manual-views-modify"> Modify a View </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/drop-view/#std-label-manual-views-remove"> Remove a View </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-view-materialized-view-compare"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Comparison with On-Demand Materialized Views <a class="headerlink leafygreen-ui-1kepx47" href="#comparison-with-on-demand-materialized-views" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="comparison-with-on-demand-materialized-views"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> MongoDB provides two different view types: <strong> standard views </strong> and <strong> on-demand materialized views </strong> . Both view types return the results from an aggregation pipeline. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Standard views are computed when you read the view, and are not stored to disk. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> On-demand materialized views are stored on and read from disk. They use a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/merge/#mongodb-pipeline-pipe.-merge"> <code class="leafygreen-ui-1l06pbn"> $merge </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/out/#mongodb-pipeline-pipe.-out"> <code class="leafygreen-ui-1l06pbn"> $out </code> </a> stage to update the saved data. </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"> When using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/merge/#mongodb-pipeline-pipe.-merge"> <code class="leafygreen-ui-1l06pbn"> $merge </code> </a> , you can use <a class="leafygreen-ui-tqgtui" href="/docs/manual/changeStreams/#std-label-changeStreams"> change streams </a> to watch for changes on the materialized view. When using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/out/#mongodb-pipeline-pipe.-out"> <code class="leafygreen-ui-1l06pbn"> $out </code> </a> , you can't watch for changes on the materialized view. </p> </div> </div> </li> </ul> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#indexes" 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="indexes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Standard views use the indexes of the underlying collection. As a result, you cannot create, drop or re-build indexes on a standard view directly, nor get a list of indexes on the view. </p> <p class="leafygreen-ui-1kp3ins"> You can create indexes directly on on-demand materialized views because they are stored on disk. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Performance <a class="headerlink leafygreen-ui-1kepx47" href="#performance" 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="performance"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> On-demand materialized views provide better read performance than standard views because they are read from disk instead of computed as part of the query. This performance benefit increases based on the complexity of the pipeline and size of the data being aggregated. </p> </section> <span class="leafygreen-ui-1qnjd6d" id="std-label-manual-views-behavior"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following sections describe behavior specific to views. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Read Only <a class="headerlink leafygreen-ui-1kepx47" href="#read-only" 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-only"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Views are read-only. Write operations on views return an error. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Snapshot Isolation <a class="headerlink leafygreen-ui-1kepx47" href="#snapshot-isolation" 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="snapshot-isolation"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Views do not maintain timestamps of collection changes and do not support point-in-time or snapshot read isolation. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-views-pipelines"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> View Pipelines <a class="headerlink leafygreen-ui-1kepx47" href="#view-pipelines" 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="view-pipelines"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The view's underlying aggregation pipeline is subject to the 100 megabyte memory limit for blocking sort and blocking group operations. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 6.0, pipeline stages that require more than 100 megabytes of memory to execute write temporary files to disk by default. These temporary files last for the duration of the pipeline execution and can influence storage space on your instance. In earlier versions of MongoDB, you must pass <code class="leafygreen-ui-1l06pbn"> { allowDiskUse: true } </code> to individual <code class="leafygreen-ui-1l06pbn"> find </code> and <code class="leafygreen-ui-1l06pbn"> aggregate </code> commands to enable this behavior. </p> <p class="leafygreen-ui-1kp3ins"> Individual <code class="leafygreen-ui-1l06pbn"> find </code> and <code class="leafygreen-ui-1l06pbn"> aggregate </code> commands can override the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.allowDiskUseByDefault"> <code class="leafygreen-ui-1l06pbn"> allowDiskUseByDefault </code> </a> parameter by either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Using <code class="leafygreen-ui-1l06pbn"> { allowDiskUse: true } </code> to allow writing temporary files out to disk when <code class="leafygreen-ui-1l06pbn"> allowDiskUseByDefault </code> is set to <code class="leafygreen-ui-1l06pbn"> false </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Using <code class="leafygreen-ui-1l06pbn"> { allowDiskUse: false } </code> to prohibit writing temporary files out to disk when <code class="leafygreen-ui-1l06pbn"> allowDiskUseByDefault </code> is set 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> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For MongoDB Atlas, it is recommended to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/cluster-autoscaling/#std-label-cluster-autoscaling" target="_self"> <span> configure storage auto-scaling </span> </a> to prevent long-running queries from filling up storage with temporary files. </p> <p class="leafygreen-ui-1kp3ins"> If your Atlas cluster uses storage auto-scaling, the temporary files may cause your cluster to scale to the next storage tier. </p> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Time Series Collections <a class="headerlink leafygreen-ui-1kepx47" href="#time-series-collections" 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="time-series-collections"> </div> </a> </h3> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-manual-timeseries-collection"> Time series collections </a> are writable non-materialized views. Limitations for views apply to time series collections. For more information, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-limitations/#std-label-manual-timeseries-collection-limitations"> Time Series Collection Limitations. </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot create a view from a time series bucket collection namespace (namely, a collection prefixed with <code class="leafygreen-ui-1l06pbn"> system.buckets </code> ). </p> </li> </ul> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Do not attempt to create a time series collection or view with the name <code class="leafygreen-ui-1l06pbn"> system.profile </code> . MongoDB 6.3 and later versions return an <code class="leafygreen-ui-1l06pbn"> IllegalOperation </code> error if you attempt to do so. <strong> Earlier MongoDB versions crash. </strong> </p> </div> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Access Control <a class="headerlink leafygreen-ui-1kepx47" href="#access-control" 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="access-control"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If the deployment enforces <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-authentication"> authentication: </a> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To create a view, you must have the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-createCollection"> <code class="leafygreen-ui-1l06pbn"> createCollection </code> </a> privilege on the database that the view is created. Additionally, if you have the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-find"> <code class="leafygreen-ui-1l06pbn"> find </code> </a> privilege on the namespace of the view you want to create, you must also have the <code class="leafygreen-ui-1l06pbn"> find </code> privilege on the following resources: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The source collection or view from which the new view is created. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Any collections or views referenced in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-views-pipelines" target="_self"> <span> view pipeline. </span> </a> </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To query a view, you must have the <code class="leafygreen-ui-1l06pbn"> find </code> privilege on the view namespace. You don't need the <code class="leafygreen-ui-1l06pbn"> find </code> privilege on the source collection or any namespaces referenced in the view pipeline. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> A user with the built-in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-readWrite"> <code class="leafygreen-ui-1l06pbn"> readWrite </code> </a> role on the database has the required privileges to run the listed operations. To grant the required permissions, either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/create-users/#std-label-create-users"> Create a user </a> with the required role. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-users-and-roles/#std-label-modify-existing-user-access"> Grant the role to an existing user. </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/month/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $month (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-month--aggregation-" 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="-month--aggregation-"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $month </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-month" 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-expression-exp.-month"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns the month of a date as a number between 1 and 12. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-month" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $month </code> </span> </a> expression has the following <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> operator expression syntax <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $month: &lt;dateexpression&gt; }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$month</span>: &lt;<!-- -->dateExpression<!-- -->&gt; <!-- -->}</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 argument can be: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> An <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-date"> Date </a> , a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-timestamp"> Timestamp </a> , or an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-object-id"> ObjectID <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A document with this format: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ date: &lt;dateexpression&gt;, timezone: &lt;tzexpression&gt; }","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">{ <span class="lg-highlight-attr">date</span>: &lt;<!-- -->dateExpression<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-attr">timezone</span>: &lt;<!-- -->tzExpression<!-- -->&gt; <!-- -->}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:25%"/> <col style="width:75%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> date </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The date to which the operator is applied. <code class="leafygreen-ui-1l06pbn"> &lt;dateExpression&gt; </code> must be a valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-date"> Date </a> , a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-timestamp"> Timestamp </a> , or an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-object-id"> ObjectID <!-- --> . </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timezone </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The timezone of the operation result. <code class="leafygreen-ui-1l06pbn"> &lt;tzExpression&gt; </code> must be a valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a string formatted as either an <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones" rel="noopener noreferrer"> <span> Olson Timezone Identifier </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> or a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/List_of_UTC_time_offsets" rel="noopener noreferrer"> <span> UTC Offset </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> . If no <code class="leafygreen-ui-1l06pbn"> timezone </code> is provided, the result is in UTC. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Format </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Examples </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> Olson Timezone Identifier </code> </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":"\"America/New_York\"\n\"Europe/London\"\n\"GMT\""} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">"America/New_York"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">"Europe/London"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">"GMT"</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> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> UTC Offset </code> </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":"+/-[hh]:[mm], e.g. \"+04:45\"\n+/-[hh][mm], e.g. \"-0530\"\n+/-[hh], e.g. \"+03\""} </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 none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">+/-[hh]:[mm], e.g. "+04:45"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">+/-[hh][mm], e.g. "-0530"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">+/-[hh], e.g. "+03"</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> </td> </tr> </tbody> </table> </div> </div> </div> </td> </tr> </tbody> </table> </div> </li> </ul> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:90%"/> <col style="width:10%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Result </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $month: new Date(\"2016-01-01\") }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$month</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2016-01-01"</span>) }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 1 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $month: { date: new Date(\"Nov 7, 2003\") } }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$month</span>: <!-- -->{ <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"Nov 7, 2003"</span>) } }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 11 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $month: ISODate(\"2000-01-01T00:00:00Z\") }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$month</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2000-01-01T00:00:00Z"</span>) }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 1 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $month: {\n date: new Date(\"August 14, 2011\"),\n timezone: \"America/Chicago\"\n} }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$month</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"August 14, 2011"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timezone</span>: <span class="lg-highlight-string">"America/Chicago"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 8 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $month: {\n date: ISODate(\"2000-01-01T00:00:00Z\"),\n timezone: \"-0500\"\n} }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$month</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2000-01-01T00:00:00Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timezone</span>: <span class="lg-highlight-string">"-0500"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 12 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $month: \"March 28, 1976\" }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$month</span>: <span class="lg-highlight-string">"March 28, 1976"</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> error </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $month: {\n date: Date(\"2016-01-01\"),\n timezone: \"-0500\"\n} }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$month</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2016-01-01"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timezone</span>: <span class="lg-highlight-string">"-0500"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> error </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <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":"{ $month: \"2009-04-09\" }","programmingLanguage":"JavaScript"} </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 javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$month</span>: <span class="lg-highlight-string">"2009-04-09"</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> error </code> </div> </div> </td> </tr> </tbody> </table> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> $month cannot take a string as an argument. </strong> </h3> <div class="leafygreen-ui-9mycqc"> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" 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="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Consider a <code class="leafygreen-ui-1l06pbn"> sales </code> collection with the following document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.sales.insertOne(\n {\n \"_id\" : 1,\n \"item\" : \"abc\",\n \"price\" : 10,\n \"quantity\" : 2,\n \"date\" : ISODate(\"2014-01-01T08:15:39.736Z\")\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">sales</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">10</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-01-01T08:15:39.736Z"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following aggregation uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-month" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $month </code> </span> </a> and other date operators to break down the <code class="leafygreen-ui-1l06pbn"> date </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.sales.aggregate(\n [\n {\n $project:\n {\n year: { $year: \"$date\" },\n month: { $month: \"$date\" },\n day: { $dayOfMonth: \"$date\" },\n hour: { $hour: \"$date\" },\n minutes: { $minute: \"$date\" },\n seconds: { $second: \"$date\" },\n milliseconds: { $millisecond: \"$date\" },\n dayOfYear: { $dayOfYear: \"$date\" },\n dayOfWeek: { $dayOfWeek: \"$date\" },\n week: { $week: \"$date\" }\n }\n }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">sales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">year</span>: <!-- -->{ <span class="lg-highlight-attr">$year</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">month</span>: <!-- -->{ <span class="lg-highlight-attr">$month</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">day</span>: <!-- -->{ <span class="lg-highlight-attr">$dayOfMonth</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">hour</span>: <!-- -->{ <span class="lg-highlight-attr">$hour</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">minutes</span>: <!-- -->{ <span class="lg-highlight-attr">$minute</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">seconds</span>: <!-- -->{ <span class="lg-highlight-attr">$second</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">milliseconds</span>: <!-- -->{ <span class="lg-highlight-attr">$millisecond</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dayOfYear</span>: <!-- -->{ <span class="lg-highlight-attr">$dayOfYear</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dayOfWeek</span>: <!-- -->{ <span class="lg-highlight-attr">$dayOfWeek</span>: <span class="lg-highlight-string">"$date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">week</span>: <!-- -->{ <span class="lg-highlight-attr">$week</span>: <span class="lg-highlight-string">"$date"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following result: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : 1,\n \"year\" : 2014,\n \"month\" : 1,\n \"day\" : 1,\n \"hour\" : 8,\n \"minutes\" : 15,\n \"seconds\" : 39,\n \"milliseconds\" : 736,\n \"dayOfYear\" : 1,\n \"dayOfWeek\" : 4,\n \"week\" : 0\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"year"</span> <!-- -->: <span class="lg-highlight-number">2014</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"month"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"day"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"hour"</span> <!-- -->: <span class="lg-highlight-number">8</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"minutes"</span> <!-- -->: <span class="lg-highlight-number">15</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"seconds"</span> <!-- -->: <span class="lg-highlight-number">39</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"milliseconds"</span> <!-- -->: <span class="lg-highlight-number">736</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dayOfYear"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dayOfWeek"</span> <!-- -->: <span class="lg-highlight-number">4</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"week"</span> <!-- -->: <span class="lg-highlight-number">0</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/mitigate-psa-performance-issues/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Mitigate Performance Issues with a Self-Managed PSA Replica Set <a class="headerlink leafygreen-ui-1kepx47" href="#mitigate-performance-issues-with-a-self-managed-psa-replica-set" 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="mitigate-performance-issues-with-a-self-managed-psa-replica-set"> </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="#procedure" target="_self"> <span> Procedure </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"> In a three-member replica set with a primary-secondary-arbiter (PSA) architecture or a sharded cluster with three-member PSA shards, a data-bearing node that is down or lagged can lead to performance issues. </p> <p class="leafygreen-ui-1kp3ins"> If one data-bearing node goes down, the other node becomes the primary. Writes with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-number-"> <code class="leafygreen-ui-1l06pbn"> w:1 </code> </a> continue to succeed in this state but writes with write concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> cannot succeed and the commit point starts to lag. If your PSA replica set contains a lagged secondary and your replica set requires two nodes to majority commit a change, your commit point also lags. </p> <p class="leafygreen-ui-1kp3ins"> With a lagged commit point, two things can affect your cluster performance: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The storage engine keeps <strong> all </strong> changes that happen after the commit point on disk to retain a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-durable"> durable </a> history. The extra I/O from these writes tends to increase over time. This can greatly impact write performance and increase cache pressure. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MongoDB allows the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-oplog/#std-label-replica-set-oplog"> oplog </a> to grow past its configured size limit to avoid deleting the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetGetStatus/#mongodb-data-replSetGetStatus.optimes.lastCommittedOpTime"> <code class="leafygreen-ui-1l06pbn"> majority commit point </code> . </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> To reduce the cache pressure and increased write traffic, set <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-.votes"> <code class="leafygreen-ui-1l06pbn"> votes: 0 </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-.priority"> <code class="leafygreen-ui-1l06pbn"> priority: 0 </code> </a> for the node that is unavailable or lagging. For write operations issued with "majority", only voting members are considered to determine the number of nodes needed to perform a majority commit. Setting the configuration of the node to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-.votes"> <code class="leafygreen-ui-1l06pbn"> votes: 0 </code> </a> reduces the number of nodes required to commit a write with write concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> from two to one and allows these writes to succeed. </p> <p class="leafygreen-ui-1kp3ins"> Once the secondary is caught up, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.reconfigForPSASet/#mongodb-method-rs.reconfigForPSASet"> <code class="leafygreen-ui-1l06pbn"> rs.reconfigForPSASet() </code> </a> method to set <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-.votes"> <code class="leafygreen-ui-1l06pbn"> votes </code> </a> back to <code class="leafygreen-ui-1l06pbn"> 1 </code> . </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"> In earlier versions of MongoDB, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.enableMajorityReadConcern"> <code class="leafygreen-ui-1l06pbn"> enableMajorityReadConcern </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--enableMajorityReadConcern"> <code class="leafygreen-ui-1l06pbn"> --enableMajorityReadConcern </code> </a> were configurable allowing you to disable the default read concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> which had a similar effect. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#procedure" 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="procedure"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To reduce the cache pressure and increased write traffic for a deployment with a three-member primary-secondary-arbiter (PSA) architecture, set <code class="leafygreen-ui-1l06pbn"> { votes: 0, priority: 0 } </code> for the secondary that is unavailable or lagging: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"cfg = rs.conf();\ncfg[\"members\"][&lt;array_index&gt;][\"votes\"] = 0;\ncfg[\"members\"][&lt;array_index&gt;][\"priority\"] = 0;\nrs.reconfig(cfg);","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">cfg <!-- -->= <!-- -->rs.<span class="lg-highlight-title lg-highlight-function">conf</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">cfg<!-- -->[<span class="lg-highlight-string">"members"</span>]<!-- -->[&lt;<!-- -->array_index<!-- -->&gt;<!-- -->]<!-- -->[<span class="lg-highlight-string">"votes"</span>] <!-- -->= <span class="lg-highlight-number">0</span>;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">cfg<!-- -->[<span class="lg-highlight-string">"members"</span>]<!-- -->[&lt;<!-- -->array_index<!-- -->&gt;<!-- -->]<!-- -->[<span class="lg-highlight-string">"priority"</span>] <!-- -->= <span class="lg-highlight-number">0</span>;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">reconfig</span>(<!-- -->cfg)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If you want to change the configuration of the secondary later, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.reconfigForPSASet/#mongodb-method-rs.reconfigForPSASet"> <code class="leafygreen-ui-1l06pbn"> rs.reconfigForPSASet() </code> </a> method. </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/db.collection.getShardDistribution/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.collection.getShardDistribution() <a class="headerlink leafygreen-ui-1kepx47" href="#db.collection.getsharddistribution--" 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.collection.getsharddistribution--"> </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="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#output" target="_self"> <span> Output </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" 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="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.collection.getShardDistribution() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.collection.getShardDistribution" 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-method-db.collection.getShardDistribution"> </div> </a> </dt> <dd> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> mongosh Method </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page documents 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> method. This is <em> not </em> the documentation for a language-specific driver, such as Node.js. </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB API drivers, refer to the language-specific <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB driver documentation <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Prints the data distribution statistics for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-sharding"> sharded </a> collection. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" 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="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.collection.getShardDistribution" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> getShardDistribution() </code> </span> </a> method has the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.collection.getShardDistribution()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">collection</span>.<span class="lg-highlight-title lg-highlight-function">getShardDistribution</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> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Output <a class="headerlink leafygreen-ui-1kepx47" href="#output" 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"> </div> </a> </h2> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The behavior of <code class="leafygreen-ui-1l06pbn"> getShardDistribution() </code> changed in MongoDB Shell version 2.3.3: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB Shell version 2.3.3, <code class="leafygreen-ui-1l06pbn"> getShardDistribution() </code> only contains regular sharded data and does not account for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-orphaned-document"> orphaned documents <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Prior to MongoDB Shell version 2.3.3, <code class="leafygreen-ui-1l06pbn"> getShardDistribution() </code> accounts for both regular sharded data and orphaned documents pending deletion. If the collection contains orphaned documents, <code class="leafygreen-ui-1l06pbn"> getShardDistribution() </code> might indicate that the collection is unbalanced even if the collection is balanced in terms of regular data. The shard containing orphaned data has more documents and greater data size, but the same number of chunks compared to other shards. </p> </li> </ul> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sample Output <a class="headerlink leafygreen-ui-1kepx47" href="#sample-output" 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="sample-output"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following is a sample output for the distribution of a sharded collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"Shard shard01 at shard01/localhost:27018\n{\n data: '38.14MB',\n docs: 1000003,\n chunks: 2,\n 'estimated data per chunk': '19.07B',\n 'estimated docs per chunk': 500001\n}\n---\nShard shard02 at shard02/localhost:27019\n{\n data: '38.14B',\n docs: 999999,\n chunks: 3,\n 'estimated data per chunk': '12.71B',\n 'estimated docs per chunk': 333333\n}\n---\nTotals\n{\n data: '76.29B',\n docs: 2000002,\n chunks: 5,\n 'Shard shard01': [ '50 % data', '50 % docs in cluster', '40B avg obj size on shard' ],\n 'Shard shard02': [ '49.99 % data', '49.99 % docs in cluster', '40B avg obj size on shard' ]\n}"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">Shard shard01 at shard01/localhost:27018</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> data: '38.14MB',</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> docs: 1000003,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> chunks: 2,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> 'estimated data per chunk': '19.07B',</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> 'estimated docs per chunk': 500001</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">---</td></tr><tr class=""><td class="leafygreen-ui-7razhx">Shard shard02 at shard02/localhost:27019</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> data: '38.14B',</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> docs: 999999,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> chunks: 3,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> 'estimated data per chunk': '12.71B',</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> 'estimated docs per chunk': 333333</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">---</td></tr><tr class=""><td class="leafygreen-ui-7razhx">Totals</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> data: '76.29B',</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> docs: 2000002,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> chunks: 5,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> 'Shard shard01': [ '50 % data', '50 % docs in cluster', '40B avg obj size on shard' ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> 'Shard shard02': [ '49.99 % data', '49.99 % docs in cluster', '40B avg obj size on shard' ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Output Fields <a class="headerlink leafygreen-ui-1kepx47" href="#output-fields" 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-fields"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"Shard shard01 at &lt;host-a&gt; {\n data: &lt;size-a&gt;,\n docs: &lt;count-a&gt;,\n chunks: &lt;number&gt;,\n 'estimated data per chunk': &lt;size-a&gt;/&lt;number&gt;,\n 'estimated docs per chunk': &lt;count-a&gt;/&lt;number&gt;\n}\n---\nShard shard02 at &lt;host-b&gt;\n{\n data: &lt;size-b&gt;,\n docs: &lt;count-b&gt;,\n chunks: &lt;number&gt;,\n 'estimated data per chunk': &lt;size-b&gt;/&lt;number&gt;,\n 'estimated docs per chunk': &lt;count-b&gt;/&lt;number&gt;\n}\n---\nTotals\n{\n data: &lt;stats.size&gt;,\n docs: &lt;stats.count&gt;,\n chunks: &lt;calc&gt;,\n Shard shard01: [ &lt;estdatapercent-a&gt; % data, &lt;estdocpercent-a&gt; % docs in cluster, stats.shards[ &lt;shard-a&gt; ].avgObjSize avg obj size on shard ],\n Shard shard02: [ &lt;estdatapercent-b&gt; % data, &lt;estdocpercent-b&gt; % docs in cluster, stats.shards[ &lt;shard-b&gt; ].avgObjSize avg obj size on shard ]\n}"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" 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">Shard shard01 at &lt;host-a&gt; {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> data: &lt;size-a&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> docs: &lt;count-a&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> chunks: &lt;number of chunks-a&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> 'estimated data per chunk': &lt;size-a&gt;/&lt;number of chunks-a&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> 'estimated docs per chunk': &lt;count-a&gt;/&lt;number of chunks-a&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">---</td></tr><tr class=""><td class="leafygreen-ui-7razhx">Shard shard02 at &lt;host-b&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> data: &lt;size-b&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> docs: &lt;count-b&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> chunks: &lt;number of chunks-b&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> 'estimated data per chunk': &lt;size-b&gt;/&lt;number of chunks-b&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> 'estimated docs per chunk': &lt;count-b&gt;/&lt;number of chunks-b&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">---</td></tr><tr class=""><td class="leafygreen-ui-7razhx">Totals</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> data: &lt;stats.size&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> docs: &lt;stats.count&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> chunks: &lt;calc total chunks&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> Shard shard01: [ &lt;estDataPercent-a&gt; % data, &lt;estDocPercent-a&gt; % docs in cluster, stats.shards[ &lt;shard-a&gt; ].avgObjSize avg obj size on shard ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> Shard shard02: [ &lt;estDataPercent-b&gt; % data, &lt;estDocPercent-b&gt; % docs in cluster, stats.shards[ &lt;shard-b&gt; ].avgObjSize avg obj size on shard ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The output information displays: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;shard-x&gt; </code> is a string that holds the shard name. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;host-x&gt; </code> is a string that holds the host name(s). </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;size-x&gt; </code> is a number that includes the size of the data, including the unit of measure (e.g. <code class="leafygreen-ui-1l06pbn"> b </code> , <code class="leafygreen-ui-1l06pbn"> Mb </code> ). </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;count-x&gt; </code> is a number that reports the number of documents in the shard. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;number of chunks-x&gt; </code> is a number that reports the number of chunks in the shard. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;size-x&gt;/&lt;number of chunks-x&gt; </code> is a calculated value that reflects the estimated data size per chunk for the shard, including the unit of measure (e.g. <code class="leafygreen-ui-1l06pbn"> b </code> , <code class="leafygreen-ui-1l06pbn"> Mb </code> ). </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;count-x&gt;/&lt;number of chunks-x&gt; </code> is a calculated value that reflects the estimated number of documents per chunk for the shard. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;stats.size&gt; </code> is a value that reports the total size of the data in the sharded collection, including the unit of measure. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;stats.count&gt; </code> is a value that reports the total number of documents in the sharded collection. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;calc total chunks&gt; </code> is a calculated number that reports the number of chunks from all shards, for example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"&lt;calc&gt; = &lt;number&gt; + &lt;number&gt;","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">&lt;calc total chunks&gt; = &lt;number of chunks-a&gt; + &lt;number of chunks-b&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;estDataPercent-x&gt; </code> is a calculated value that reflects, for each shard, the data size as the percentage of the collection's total data size, for example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"&lt;estdatapercent-x&gt; = &lt;size-x&gt;/&lt;stats.size&gt;","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">&lt;estDataPercent-x&gt; = &lt;size-x&gt;/&lt;stats.size&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;estDocPercent-x&gt; </code> is a calculated value that reflects, for each shard, the number of documents as the percentage of the total number of documents for the collection, for example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"&lt;estdocpercent-x&gt; = &lt;count-x&gt;/&lt;stats.count&gt;","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">&lt;estDocPercent-x&gt; = &lt;count-x&gt;/&lt;stats.count&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> stats.shards[ &lt;shard-x&gt; ].avgObjSize </code> is a number that reflects the average object size, including the unit of measure, for the shard. </p> </li> </ul> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> After an unclean shutdown of a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/wiredtiger/"> Wired Tiger </a> storage engine, <!-- --> count and size <!-- --> statistics reported by <code class="leafygreen-ui-1l06pbn"> db.collection.getShardDistribution() </code> may be inaccurate. </p> <p class="leafygreen-ui-1kp3ins"> The amount of drift depends on the number of insert, update, or delete operations performed between the last <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/wiredtiger/#std-label-storage-wiredtiger-checkpoints"> checkpoint </a> and the unclean shutdown. Checkpoints usually occur every 60 seconds. However, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances running with non-default <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--syncdelay"> <code class="leafygreen-ui-1l06pbn"> --syncdelay </code> </a> settings may have more or less frequent checkpoints. </p> <p class="leafygreen-ui-1kp3ins"> Run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/validate/#mongodb-dbcommand-dbcmd.validate"> <code class="leafygreen-ui-1l06pbn"> validate </code> </a> on each collection on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> to restore statistics after an unclean shutdown. </p> <p class="leafygreen-ui-1kp3ins"> After an unclean shutdown: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/validate/#mongodb-dbcommand-dbcmd.validate"> <code class="leafygreen-ui-1l06pbn"> validate </code> </a> updates the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/collStats/#std-label-collstat-count"> count statistic </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collStats/#mongodb-dbcommand-dbcmd.collStats"> <code class="leafygreen-ui-1l06pbn"> collStats </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collStats/#std-label-collStats-output"> output </a> with the latest value. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Other statistics like the number of documents inserted or removed in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collStats/#mongodb-dbcommand-dbcmd.collStats"> <code class="leafygreen-ui-1l06pbn"> collStats </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collStats/#std-label-collStats-output"> output </a> are estimates. </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/core/indexes/index-types/geospatial/restrictions/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Geospatial Index Restrictions <a class="headerlink leafygreen-ui-1kepx47" href="#geospatial-index-restrictions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="geospatial-index-restrictions"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#collation-option" target="_self"> <span> Collation Option </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#covered-queries" target="_self"> <span> Covered Queries </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#shard-key" target="_self"> <span> Shard Key </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#multiple-geospatial-indexes-with--geonear" target="_self"> <span> Multiple Geospatial Indexes with <code class="css-1kekw28 e1wawog0"> $geoNear </code> </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#supported-data-types" target="_self"> <span> Supported Data Types </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#number-of-index-keys" target="_self"> <span> Number of Index Keys </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#exact-matches-on-a-flat-surface" target="_self"> <span> Exact Matches on a Flat Surface </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> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index"> 2d </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere </a> indexes are geospatial indexes. Geospatial indexes have these restrictions: </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Collation Option <a class="headerlink leafygreen-ui-1kepx47" href="#collation-option" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="collation-option"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> 2d indexes do not support the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> collation </a> option, only binary comparison. Binary comparison compares the numeric Unicode value of each character in each string, and does not account for letter case or accent marks. </p> <p class="leafygreen-ui-1kp3ins"> To create a 2d index on a collection that has a non-simple collation, you must explicitly specify <code class="leafygreen-ui-1l06pbn"> { collation: { locale: "simple" } } </code> when you create the index. </p> <p class="leafygreen-ui-1kp3ins"> For example, consider a collection named <code class="leafygreen-ui-1l06pbn"> collationTest </code> with a collation of <code class="leafygreen-ui-1l06pbn"> { locale: "en" } </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection(\n \"collationTest\",\n {\n collation: { locale: \"en\" }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light js leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"collationTest"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"en"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To create a 2d index on the <code class="leafygreen-ui-1l06pbn"> collationTest </code> collection, you must specify <code class="leafygreen-ui-1l06pbn"> { collation: { locale: "simple" } } </code> . This command creates a 2d index on the <code class="leafygreen-ui-1l06pbn"> loc </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.collationTest.createIndex(\n {\n loc: \"2d\"\n },\n {\n collation: { locale: \"simple\" }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light js leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">collationTest</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">loc</span>: <span class="lg-highlight-string">"2d"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"simple"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Covered Queries <a class="headerlink leafygreen-ui-1kepx47" href="#covered-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="covered-queries"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Geospatial indexes cannot <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-optimization/#std-label-covered-queries"> cover a query <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Shard Key <a class="headerlink leafygreen-ui-1kepx47" href="#shard-key" 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="shard-key"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You cannot use a geospatial index as a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-shard-key/#std-label-shard-key"> shard key </a> . However, you can create a geospatial index on a sharded collection by using a different field as the shard key. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Multiple Geospatial Indexes with <code class="leafygreen-ui-1l06pbn"> $geoNear </code> <a class="headerlink leafygreen-ui-1kepx47" href="#multiple-geospatial-indexes-with--geonear" 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="multiple-geospatial-indexes-with--geonear"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If your collection has multiple geospatial indexes, when you run the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/geoNear/#mongodb-pipeline-pipe.-geoNear"> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </a> pipeline stage, you must specify the <code class="leafygreen-ui-1l06pbn"> $geoNear </code> <code class="leafygreen-ui-1l06pbn"> key </code> option. The <code class="leafygreen-ui-1l06pbn"> key </code> option specifies which index to use to support the query. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Supported Data Types <a class="headerlink leafygreen-ui-1kepx47" href="#supported-data-types" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="supported-data-types"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A field indexed with a 2dsphere index must contain geometry data. Geometry data can either be: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/geojson/#std-label-geospatial-indexes-store-geojson"> GeoJSON data </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/geospatial-queries/#std-label-geospatial-legacy"> Legacy coordinate pairs </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> You cannot: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Insert a document with non-geometry data into a field that is indexed with a 2dsphere index. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Build a 2dsphere index on a field that contains non-geometry data. </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Number of Index Keys <a class="headerlink leafygreen-ui-1kepx47" href="#number-of-index-keys" 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="number-of-index-keys"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> When you create a 2dsphere index, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> maps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/geojson/#std-label-geospatial-indexes-store-geojson"> GeoJSON shapes </a> to an internal representation. The resulting internal representation may be a large array of values. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.indexMaxNumGeneratedKeysPerDocument"> <code class="leafygreen-ui-1l06pbn"> indexMaxNumGeneratedKeysPerDocument </code> </a> setting limits the maximum number of keys generated for a single document to prevent out of memory errors. If an operation requires more keys than the <code class="leafygreen-ui-1l06pbn"> indexMaxNumGeneratedKeysPerDocument </code> parameter specifies, the operation fails. </p> <p class="leafygreen-ui-1kp3ins"> By default, the server allows up to <code class="leafygreen-ui-1l06pbn"> 100,000 </code> index keys per document. To allow more index keys, raise the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.indexMaxNumGeneratedKeysPerDocument"> <code class="leafygreen-ui-1l06pbn"> indexMaxNumGeneratedKeysPerDocument </code> </a> value. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Exact Matches on a Flat Surface <a class="headerlink leafygreen-ui-1kepx47" href="#exact-matches-on-a-flat-surface" 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="exact-matches-on-a-flat-surface"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A 2d index cannot improve performance for exact matches on a coordinate pair. </p> <p class="leafygreen-ui-1kp3ins"> For example, consider a <code class="leafygreen-ui-1l06pbn"> contacts </code> collection with these documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.contacts.insertMany( [\n {\n name: \"Evander Otylia\",\n phone: \"202-555-0193\",\n address: [ 55.5, 42.3 ]\n },\n {\n name: \"Georgine Lestaw\",\n phone: \"714-555-0107\",\n address: [ -74, 44.74 ]\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">contacts</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">"Evander Otylia"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">phone</span>: <span class="lg-highlight-string">"202-555-0193"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">address</span>: <!-- -->[ <span class="lg-highlight-number">55.5</span>, <span class="lg-highlight-number">42.3</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">"Georgine Lestaw"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">phone</span>: <span class="lg-highlight-string">"714-555-0107"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">address</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">74</span>, <span class="lg-highlight-number">44.74</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> A 2d index on the <code class="leafygreen-ui-1l06pbn"> address </code> field <strong> does not </strong> improve performance for the following query: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.contacts.find( { address: [ 55.5, 42.3 ] } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">contacts</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">address</span>: <!-- -->[ <span class="lg-highlight-number">55.5</span>, <span class="lg-highlight-number">42.3</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"> To improve performance for this query, create either an ascending or descending index on the <code class="leafygreen-ui-1l06pbn"> address </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.contacts.createIndex( { address: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">contacts</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">address</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </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> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/internals/#std-label-2d-index-internals"> 2d Index Internals </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-properties/#std-label-index-properties"> Index Properties </a> </p> </li> </ul> </section> </section>