Skip to content

Commit

Permalink
fix(helpers): fix $position of insert new data history 🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBrisorgueil committed Apr 11, 2020
1 parent 3a098e4 commit 70a728c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/helpers/montaineSave.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ const prepareMongoose = (object, date) => {
edit.update.$push = {};
edit.update.$push[`${path}`] = {};
edit.update.$push[`${path}`].$each = [value[0]];
edit.update.$push[`${path}`].$position = -1;
edit.update.$push[`${path}`].$position = 0;
} else {
edit.filter[`${k}.0.value`] = { $ne: value[0].value };
edit.update.$push = {};
edit.update.$push[`${k}`] = {};
edit.update.$push[`${k}`].$each = [value[0]];
edit.update.$push[`${k}`].$position = -1;
edit.update.$push[`${k}`].$position = 0;
}
edit.upsert = false;
edits.push(edit);
Expand Down

0 comments on commit 70a728c

Please sign in to comment.