Skip to content

Commit

Permalink
fix: preserve id on update
Browse files Browse the repository at this point in the history
Leave the id property alone on update
  • Loading branch information
Hage Yaapa committed Jul 1, 2019
1 parent e62a055 commit cac1f57
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/mongodb.js
Original file line number Diff line number Diff line change
Expand Up @@ -1606,8 +1606,6 @@ MongoDB.prototype.update = MongoDB.prototype.updateAll = function updateAll(
const idName = this.idName(modelName);

where = self.buildWhere(modelName, where, options);

delete data[idName];
data = self.toDatabase(modelName, data);

// Check for other operators and sanitize the data obj
Expand Down

0 comments on commit cac1f57

Please sign in to comment.