Closed Harm-Nullix closed 1 year ago
I'm not familliar with this package or the hook executed at line 199 but it feels like this.update
should be updated to this.updateOne
Opened a PR (#102) of what I think is the easiest fix for this.
Before the PR is merged, I manage to bypass the bug by following example.
const temp = new Model({ pwd })
temp.encryptFieldsSync()
const $set = { pwd: encrypted, __enc_pwd: true }
await Model.findOneAndUpdate({ id }, { $set }).exec()
Just updated to
mongoose@7.3.0
Model:
Executed code
Error:
Working:
Not working:
Must be related to https://mongoosejs.com/docs/migrating_to_7.html#removed-update