title: Confused as to how $pullAll works in MongoDB
body: <p>I've got a document that looks like this:</p>
  
  <pre><code>db.blog.findOne()
  {
          "_id" : ObjectId("4dc1c938c4bfb4d21a000001"),
          "blogid" : 1,
          "body" : "Lorem ipsum dolor",
          "comments" : [
                  {
                          "id" : 1,
                          "name" : "Alex",
                          "comment" : "Test",
                          "approved" : 1
                  },
                  {
                          "id" : 2,
                          "name" : "Phil",
                          "comment" : "Test",
                          "approved" : 1
                  },
                  {
                          "id" : 3,
                          "name" : "Joe",
                          "comment" : "Test",
                          "approved" : 0
                  }
          ],
          "no_comments" : 11,
          "title" : "Hello world"
  }
  </code></pre>
  
  <p>If I run the query</p>
  
  <pre><code>db.blog.update({'blogid':1}, { $pull : { 'comments' : {'approved' : 0} } });
  </code></pre>
  
  <p>Then it will remove the third comment.</p>
  
  <p>If instead I want to pull all comments where approved is 0 or 1 the following query doesn't work:</p>
  
  <pre><code>db.blog.update({'blogid':1}, { $pullAll : { 'comments' : {'approved' : [0,1]} } });
  </code></pre>
  
  <p>I get the error</p>
  
  <blockquote>
    <p>Modifier $pushAll/pullAll allowed for
    arrays only</p>
  </blockquote>
  
  <p>Can someone please explain where I'm going wrong?</p>
  
  <p>Thank you</p>