title: How to update all documents in a collection with same key but different values?
body: <p>I have 10 documents in a collection:</p>
  
  <pre><code>&gt;&gt; {'_id':0, 'self':{....}} {'_id':1,'self':{....}} ........ {'_id':9,'self':{....}}
  </code></pre>
  
  <p>now I want to update all documents with their count, which means after the updating, the documents will look like:</p>
  
  <pre><code>&gt;&gt; {'_id':0, 'count':0, 'self':{....}} {'_id':1,'count':1, 'self':{....}} ........ {'_id':9,'count':9,'self':{....}}
  </code></pre>
  
  <p>I know there is a <code>update({},{'$set':{}})</code> method but I don't know how to use this to update different values for each document. Does anyone know some fast methods to do this?</p>