diff --git a/lib/document.js b/lib/document.js index 4104fa8..ec2fbd8 100644 --- a/lib/document.js +++ b/lib/document.js @@ -204,7 +204,6 @@ Document.prototype.replace = function(newValue, options, query, internalOptions) Document.handleReplaceValue = function(self, replaceValue, primaryKey, options) { var result = util.writeResult(); if (replaceValue === null) { - console.log('@@@@@@@@@@@@@@@@@@@@@@2'); self.delete({}); result.deleted++; } diff --git a/lib/utils.js b/lib/utils.js index 1a95abb..f872c09 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -613,7 +613,7 @@ util._merge = function _merge(self, obj) { } } else { - changed = util._merge.call(self[key], obj[key]) || changed; + changed = util._merge.call(util, self[key], obj[key]) || changed; } } else { diff --git a/test/writing-data.js b/test/writing-data.js index c0c98ab..dd470bd 100644 --- a/test/writing-data.js +++ b/test/writing-data.js @@ -590,6 +590,14 @@ describe('writing-data.js', function(){ var query = r.db(TEST_DB).table(TEST_TABLE).get(1); compare(query, done); }); + it('update - 34 - more update', function(done) { + var query = r.db(TEST_DB).table(TEST_TABLE).get(1).update({foo: {bar2: {buzz2: 3}}}); + compare(query, done); + }); + it('update - 34 - more follow up', function(done) { + var query = r.db(TEST_DB).table(TEST_TABLE).get(1); + compare(query, done); + }); it('replace - 1', function(done) { var query = r.db(TEST_DB).table(TEST_TABLE).get(1).replace({id: 1, foo: 200});