title: Remove array from objects field in MongoDB
body: <p>I am trying to remove an element of Array just by finding it via the ObjectId in the array element. Following <a href="https://stackoverflow.com/questions/18395412/mongodb-opposite-of-addtoset-to-removefromset">MongoDB opposite of $addToSet to &#39;$removeFromSet&#39;</a>, I should've been able to do:</p>
  <pre><code>db.collection.update(
    {name: 'nameOfNode'}, 
    {$pull: { activities: [&quot;5e7d16e9736bb64bdd158c13&quot;]}})
  </code></pre>
  <p>or</p>
  <pre><code>db.collection.update(
    {name: 'nameOfNode'}, 
    {$pull: { activities: [&quot;5e7d16e9736bb64bdd158c13&quot;, &quot;Materi&quot;]}})
  
  </code></pre>
  <p>Yet both of these codes above doesn't work, does if there is another way to remove them by just one single value, or if that isn't possible, remove them with the two values?</p>
  <p><a href="https://i.stack.imgur.com/9FAEg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9FAEg.png" alt="current data schema" /></a></p>
  <blockquote>
  <p>Note: I have removed some confidential information from the screenshot, hence the supposed gaps between the letters are not spaces, but covered texts. The strings I've tried to use to refer to them are identical though, no difference.</p>
  </blockquote>