title: Iterate over every document in mongodb from nodejs
body: <p>My current code: </p>
  
  <pre><code>  var cursor = db.get('unameMap').find()
    cursor.forEach(function(doc){  
        console.log("considering: " + doc)
    });
  </code></pre>
  
  <p>All other requests to the database work, so assume <code>var db</code> is defined correctly.</p>
  
  <p>For some reason this code doesn't produce anything in the console, tried it on a few different collections and it just doesn't do anything.</p>
  
  <p>All other mongo code such as <code>.aggregate</code> works fine</p>
  
  <p>Ultimately I want to do this (update a property on every document in a collection)</p>
  
  <pre><code>var cursor = db.get('unameMap').find()
    cursor.forEach(function(doc){  
        console.log("considering: " + doc)
        doc.testProperty="newValue"
        db.get('unameMap').save(doc);
    });
  </code></pre>