title: Is there a way to perform a "dry run" of an update operation?
body: <p>I am in the process of changing the schema for one of my MongoDB collections. (I had been storing dates as strings, and now my application stores them as <code>ISODate</code>s; I need to go back and change all of the old records to use <code>ISODate</code>s as well.) I think I know how to do this using an update, but since this operation will affect tens of thousands of records I'm hesitant to issue an operation that I'm not 100% sure will work. Is there any way to do a "dry run" of an update that will show me, for a small number of records, the original record and how it would be changed?</p>
  
  <hr>
  
  <p><strong>Edit:</strong> I ended up using the approach of adding a new field to each record, and then (after verifying that the data was right) renaming that field to match the original. It looked like this:</p>
  
  <pre><code>db.events.find({timestamp: {$type: 2}})
      .forEach( function (e) {
          e.newTimestamp = new ISODate(e.timestamp);
          db.events.save(e);
      } )
  
  db.events.update({},
      {$rename: {'newTimestamp': 'timestamp'}},
      {multi: true})
  </code></pre>
  
  <p>By the way, that method for converting the string times to <code>ISODate</code>s was what ended up working. (I got the idea from <a href="https://stackoverflow.com/a/3792958/371228">this SO answer</a>.)</p>