title: MongoDB $pull query not remove and update the existing record
body: <p>My main concern is about in mongodb documentation they use <code>$elemMatch</code> command for find and pull the element from array, but this is not work when i use.
  My document structure is</p>
  
  <pre><code>{
  "_id" : ObjectId("55dea445c3ad8cac03a7ed8e"),
  "email" : "james@user.com",
  "groups" : [ 
      {
          "_id" : ObjectId("55dea4a4c3ad8c8005a7ed8f"),
          "name" : "All Group"
      }
  ]}
  </code></pre>
  
  <p>I want to remove groups from document using mongodb query. My Query is : </p>
  
  <pre><code>db.users.update({"_id": ObjectId('55dea445c3ad8cac03a7ed8e')}, 
  {$pull: {"groups": {$elemMatch: {"_id": ObjectId('55dea4a4c3ad8c8005a7ed8f')}}}})
  </code></pre>
  
  <p>After executing the query, the user document not updated and groups value still there. I am following mongodb documentation as: <a href="http://docs.mongodb.org/v2.6/reference/operator/update/pull/" rel="noreferrer">http://docs.mongodb.org/v2.6/reference/operator/update/pull/</a></p>