wprl/baucis — pull request #90 by lukaszfiszer (2013-12-18 00:53:46+00:00)
Title: Invoke "remove" middleware on DELETE requests

Contrary to POST and PUT request that invoke "save" middleware on Mongoose documents, when doing DELETE request the remove middleware is not called. It is because the DELETE requests is done by Model#remove method, which is direct MongoDB query (see: http://mongoosejs.com/docs/api.html#model_Model.remove)

The solution: Instead of removing documents with a direct MongoDB query (Model#remove method), first retrieve them from DB and then call the remove method on those documents instances.