title: Multiple updates on a single field causes "Updating the path 'X' would create a conflict at 'X'" in mongoDB
body: <p>I have the following update operation:</p>
  <pre><code>private async onCategoryImagesModified(data: ModifiedFilesEventData) {
          this.categoryModel
              .findByIdAndUpdate(data.resourceId, {
                  $pullAll: { images: data.removedFiles || [] },
                  $addToSet: { images: { $each: data.addedFiles || [] } }
              }).catch(error =&gt; this.logger.warn(error))
  }
  </code></pre>
  <p>Basically, every time images of model <code>category</code> changes I want to update the document by removing all the removed paths from <code>images</code> <strong>and</strong> adding the new paths to <code>images</code>.</p>
  <p>I get that I can't reference the same field more than once inside an update, but is there a way to do this <strong>without</strong> 2 separate update operations?</p>