title: Removing elements from embedded array by matching with different array in mongoose
body: <p>i have an embedded array of tweets in my Mongodb and with every tweet comes a tweetID (not to be confused with the mongodb assigned id).</p>
  
  <pre><code>{
  "_id": {
      "$oid": "54d95cb062917897ad26c5e5"
  },
  "name": "foo",
  "tweets": [
      {
          "tweetID": "1234",
          "text": "bla bla bla"
      },
      {
          "tweetID": "4321",
          "text": "bla bla bla",
      }
  
  ... and so on
  </code></pre>
  
  <p>Now in my app I have another array full of tweetID's that should be deleted.</p>
  
  <pre><code>var tweetsToBeDeleted = [ "1234", "4321" ];
  </code></pre>
  
  <p>And i am trying to get mongoose to do so with:</p>
  
  <pre><code>ChannelsModel.update( { },
                        { $pull: { tweets: { $elemMatch: { tweetID: tweetsToBeDeleted } } } },
                        { multi: true },
                        function ( err ) {
                           console.log( "err - " + err );
                        } 
  );
  </code></pre>
  
  <p>But when i try to run this, nothing gets deleted. The error callback will executed but <code>err</code> is <code>null</code>.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks in advance!</p>