title: MongoDB, remove object from array
body: <p>Doc:</p>
  <pre><code>{
     _id: 5150a1199fac0e6910000002,
     name: 'some name',
     items: [{
        id: 23,
        name: 'item name 23'
     },{
        id: 24,
        name: 'item name 24'
     }]
  }
  </code></pre>
  <p>Is there a way to pull a specific object from an array?  I.E. how do I pull the entire item object with id 23 from the items array.</p>
  <p>I have tried:</p>
  <pre><code>db.mycollection.update({'_id': ObjectId(&quot;5150a1199fac0e6910000002&quot;)}, {$pull: {id: 23}});
  </code></pre>
  <p>However I am pretty sure that I am not using 'pull' correctly.  From what I understand pull will pull a field from an array but not an object.</p>
  <p>Any ideas how to pull the entire object out of the array.</p>
  <p>As a bonus I am trying to do this in mongoose/nodejs, as well not sure if this type of thing is in the mongoose API but I could not find it.</p>