Merge branch 'master' of github.com:1602/jugglingdb
This commit is contained in:
commit
11fc70b89a
|
@ -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)
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue