diff --git a/lib/Scan.js b/lib/Scan.js index c82d40b6c..08d222200 100644 --- a/lib/Scan.js +++ b/lib/Scan.js @@ -52,19 +52,13 @@ Scan.prototype.exec = function (next) { var scanReq = { }; - function toModel (item, skipParsing) { - var model; - - if (!skipParsing) { - model = new Model(); - schema.parseDynamo(model, item); - } else { - model = new Model(item); - } - + function toModel (item) { + var model = new Model(); model.$__.isNew = false; + schema.parseDynamo(model, item); debug('scan parsed model', model); + return model; } @@ -79,7 +73,10 @@ Scan.prototype.exec = function (next) { return deferred.resolve([]); } return deferred.resolve(data.Items.map(function (item) { - return toModel(item, true); + var model = new Model(item); + model.$__.isNew = false; + debug('scan parsed model', model); + return model; })); } }); diff --git a/package.json b/package.json index 3a1aebcdc..fb1b0928b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dynamoose", - "version": "0.8.4", + "version": "0.8.5", "description": "Dynamoose is a modeling tool for Amazon's DynamoDB (inspired by Mongoose)", "typings": "./dynamoose.d.ts", "homepage": "https://github.com/automategreen/dynamoose",