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

Commit

Permalink
fix: Remove deletion of __v when creating history doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kirkeaton committed Oct 14, 2020
1 parent 8fc54eb commit afc6756
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 afc6756

Please sign in to comment.