title: Updating the path 'packages.$[pkg10].items' would create a conflict at 'packages'
body: <p>I am trying to do following update in mongo, and getting error:</p>
  <pre><code>db.xyz.updateOne(
      { &quot;xyzId&quot;: 1 },
      {
          $push: { &quot;packages&quot;: { &quot;id&quot;: 11 } },
          $pull: { &quot;packages.$[pkg10].items&quot;: { &quot;id&quot;: 1000 } }
  
      },
  
      {
          arrayFilters: [{ &quot;pkg10.id&quot;: 1 }]
      }
  )
  </code></pre>
  <p>Error:</p>
  <pre><code>{
      &quot;message&quot; : &quot;Updating the path 'packages.$[pkg10].items' would create a conflict at 'packages'&quot;,
      &quot;stack&quot; : &quot;script:1:11&quot;,
      &quot;name&quot; : &quot;WriteError&quot;,
      &quot;code&quot; : 40,
      &quot;index&quot; : 0
  }
  </code></pre>
  <p>My question is why this is not able to first add one package in order and then remove item from another specified package ?
  And how can I know which kinds of updates can lead this type of error.</p>
  <p>Similar Question,(but was not helpful): <a href="https://stackoverflow.com/questions/50947772/updating-the-path-x-would-create-a-conflict-at-x">Updating the path &#39;x&#39; would create a conflict at &#39;x&#39;</a></p>