From 8bb07ad840f048669ab4338775823479d0a59eed Mon Sep 17 00:00:00 2001 From: Louis Chatriot Date: Fri, 31 May 2013 17:04:17 +0200 Subject: [PATCH] All queries work --- lib/datastore.js | 3 --- test/db.test.js | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) 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(); });