diff --git a/lib/datastore.js b/lib/datastore.js index e07cb8b..83ad0f6 100644 --- a/lib/datastore.js +++ b/lib/datastore.js @@ -444,7 +444,6 @@ Datastore.prototype._update = function (query, updateQuery, options, cb) { return callback(err); } - self.persistNewState(updatedDocs, function (err) { if (err) { return callback(err); } return callback(null, numReplaced); @@ -490,8 +489,6 @@ Datastore.prototype._remove = function (query, options, cb) { }); } catch (err) { return callback(err); } - - self.persistNewState(removedDocs, function (err) { if (err) { return callback(err); } diff --git a/test/db.test.js b/test/db.test.js index 4ad22d4..acc13e7 100644 --- a/test/db.test.js +++ b/test/db.test.js @@ -535,7 +535,7 @@ describe('Database', function () { }); // ==== End of 'Find' ==== // - describe.only('Update', function () { + describe('Update', function () { it("If the query doesn't match anything, database is not modified", function (done) { async.waterfall([ @@ -1079,15 +1079,15 @@ describe('Database', function () { d.insert({ a: 3 }, function () { d.insert({ a: 5 }, function () { d.datafileSize.should.equal(3); - d.data.length.should.equal(3); + d.getAllData().length.should.equal(3); d.remove({ a: 3 }, {}, function () { d.datafileSize.should.equal(4); - d.data.length.should.equal(2); + d.getAllData().length.should.equal(2); d.remove({ a: { $in: [2, 5] } }, { multi: true }, function () { d.datafileSize.should.equal(6); - d.data.length.should.equal(0); + d.getAllData().length.should.equal(0); done(); });