tommy351/warehouse — pull request #1 by heroicyang (2014-04-21 13:51:19+00:00)
Title: Fix destroy didn't delete all data in the store

Hi, tommy.

There is a problem, after I delete data by using `model.destroy()`, I can get to the data before by using `db.model('modelName').find({})`. So I can't do validation in the `pre` hook, for example:

```javascript
UserSchema.pre('save', function(user, next) {
var exists = db.model('User').findOne({ name: user.name });
if (exists) {
return next(new Error('User name already exists');
}

next();
});

// ...

var User = db.model('User', UserSchema);
User.insert({ name: 'heroic' });
User.insert({ name: 'heroic' }); // throw an error, expected
User.destroy();
User.insert({ name: 'heroic' }); // throw an error, unexpected
```