title: mongodb Cannot apply $pull/$pullAll modifier to non-array, How to remove array element
body: <p>i met a problem about mongodb.</p>
  
  <pre><code>db.tt.find()
  { "_id" : ObjectId("513c971be4b1f9d71bc8c769"), 
    "name" : "a", 
    "comments" : [ { "name" : "2" }, { "name" : "3" } ] 
  }
  </code></pre>
  
  <p>above is a test document.</p>
  
  <p>i want to pull comments.name = 2</p>
  
  <p>i do </p>
  
  <pre><code>db.tt.update({'comments.name':'2'},{'$pull':{'comments.$.name':'2'}});
  </code></pre>
  
  <p>but the console print these message:</p>
  
  <p>Cannot apply $pull/$pullAll modifier to non-array</p>
  
  <p>my mongodb version is 2.0.6</p>
  
  <p>who can help me? Thank you very much</p>