Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #62 from kirkeaton/bug/__v
Browse files Browse the repository at this point in the history
fix: Remove deletion of __v when creating history doc
  • Loading branch information
nassor authored Nov 2, 2020
2 parents 8fc54eb + afc6756 commit 1940e59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mongoose-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ module.exports = function historyPlugin(schema, options) {
});

function createHistoryDoc(d, operation) {
d.__v = undefined;
const { __v, ...doc } = d;

let historyDoc = {};
historyDoc['t'] = new Date();
historyDoc['o'] = operation;
historyDoc['d'] = d;
historyDoc['d'] = doc;

return historyDoc;
}
Expand Down

0 comments on commit 1940e59

Please sign in to comment.