Merge branch 'master' of github.com:1602/jugglingdb

This commit is contained in:
Anatoliy Chakkaev 2012-06-25 14:13:38 +04:00
commit 11fc70b89a
1 changed files with 1 additions and 0 deletions

View File

@ -183,6 +183,7 @@ MongooseAdapter.prototype.destroyAll = function destroyAll(model, callback) {
this._models[model].find(function (err, data) { this._models[model].find(function (err, data) {
if (err) return callback(err); if (err) return callback(err);
wait = data.length; wait = data.length;
if (!data.length) return callback(null);
data.forEach(function (obj) { data.forEach(function (obj) {
obj.remove(done) obj.remove(done)
}); });