Skip to content

Commit

Permalink
fix map issue in 0.8.4, closes dynamoose#199
Browse files Browse the repository at this point in the history
  • Loading branch information
brandongoode committed Aug 30, 2017
1 parent 2444c47 commit cc812d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
19 changes: 8 additions & 11 deletions lib/Scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}));
}
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit cc812d8

Please sign in to comment.