title: Mongoose query.remove() callback not being called
body: <p>I've been banging my head against the desk for about 2 hours on this issue, and I can't seem to find a solution.</p>
  
  <p>Here's the problem code: </p>
  
  <pre><code>/* Users */
  
  var mongoose = require("mongoose");
  
  var User = new mongoose.Schema({
      a: String,
      d: String
  });
  
  var removeByDeviceToken = function(device_token, callback) {
  
      this.findOne({ d: device_token }, function(error, user) {
          if (error) {
              callback(error);
          } else if (user) {
              user.remove(function(error) {
                  callback(error);
              });
          } else {
              callback(new Error("No users with that device token were found."));
          }
      });
  };
  
  User["static"]("removeByDeviceToken", removeByDeviceToken);
  mongoose.model("User", User);
  </code></pre>
  
  <p>The problem is quite simply that the callback for user.remove() is not being called. (The user itself isn't being removed either.)</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT</strong>: After some more testing, it appears that the middleware I have defined for removals is being called.  It also might be relevant that I'm hosting the DB on MongoHQ.</p>
  
  <p><strong>EDIT #2</strong>: After days of testing, it turns out the issue was because in the middleware I had defined for removals, I forgot to call the next() function. <em>facepalm</em></p>