title: Remove null element from mongo array
body: <pre><code>{
          "_id" : 160,
          "info" : [
              {
                  'name': 'Serg',
                  'proff': 'hacker'
              },
              null,
          ]
      }
  </code></pre>
  
  <p>As you can see I have null element in my array, I need a general solution that will remove null elements from info array.</p>
  
  <p>I tried this:</p>
  
  <pre><code>for doc in iter:
      people.update({ '_id' : doc['_id']}, { '$pull' : { 'info' : 'null' }})
  </code></pre>
  
  <p>where <code>iter</code> is a collection of documents. and <code>people</code> is a collection</p>
  
  <p>I also tried this in the shell:</p>
  
  <pre><code>&gt; db.people.findAndModify({ query: {}, update: {'$pull': {info:null} } } )
  </code></pre>
  
  <p>But none of the above examples delete this null from my documents!! ))</p>