diff --git a/lib/resources/collection/index.js b/lib/resources/collection/index.js index 3887009..8555b26 100644 --- a/lib/resources/collection/index.js +++ b/lib/resources/collection/index.js @@ -467,9 +467,13 @@ Collection.prototype.save = function (ctx, fn) { } if(err) return done(err); + // copy previous obj + Object.keys(obj).forEach(function (key) { + prev[key] = obj[key]; + }); + // merge changes Object.keys(item).forEach(function (key) { - prev[key] = obj[key]; obj[key] = item[key]; });