title: How to test mongodb save() method failure?
body: <p>I have a working script, and in my node code, I have instances of <code>save()</code>, like the following:</p>
  
  <pre><code>user.remove(function(error, removedMeasurement) {
      if (error) {...} else {...}
  });
  </code></pre>
  
  <p>I would like to confirm that something is done when handling an error during the <code>save()</code>. I tried killing my connection to the db after I started the process, but then the process just hangs without error. </p>
  
  <p>My connection to the db is similar to 
  <code>db = mongoose.createConnection(connectionToDb, options);</code> </p>
  
  <p>and the options include:</p>
  
  <pre><code>reconnectTries:60,
  reconnectInterval:2000
  </code></pre>
  
  <p>If I restart the db connection right away, the script will continue, so I think the above attribute options have something to do with this, and so killing the db connection does not help trigger the error to confirm I am handling it correctly.</p>