title: How to remove an element from a doubly-nested array in a MongoDB document
body: <p>I have a document structure something along the lines of the following:</p>
  <pre class="lang-js prettyprint-override"><code>{
  &quot;_id&quot; : &quot;777&quot;,
  &quot;someKey&quot; : &quot;someValue&quot;,
  &quot;someArray&quot; : [
      {
          &quot;name&quot; : &quot;name1&quot;,
          &quot;someNestedArray&quot; : [
              {
                  &quot;name&quot; : &quot;value&quot;
              },
              {
                  &quot;name&quot; : &quot;delete me&quot;
              }
          ]
      }
    ]
  }
  </code></pre>
  <p>I want to delete the nested array element with the value &quot;delete me&quot;.</p>
  <p>I know I can find documents which match this description using nested <code>$elemMatch</code> expressions. What is the query syntax for removing the element in question?</p>