You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have added mongooseFieldEncryption plugin to our schema which is encrypting the relevant fields as expected when save is used. But the problem is with the replaceOne function.
To update an existing document in mongoose collection, we use replaceOne. When replaceOne is used, the field which was already encrypted in the document is replaced with an actual field value (i.e. the field stays unencrypted).
In the documentation of mongoose-field-encryption, there is no information w.r.t replaceOne. Could you give us some insights regarding this?
The text was updated successfully, but these errors were encountered:
At the moment replaceOne functionality has not been implemented. I can look into this but cannot guarantee when it will be done. In the meantime, can you maybe just do a delete and insert a new document? Or rather insert a new one first and delete the old one or just do findOneAndUpdate which is supported.
There are a bunch of tests which you can use as a reference point for all available functionality:
We have added mongooseFieldEncryption plugin to our schema which is encrypting the relevant fields as expected when save is used. But the problem is with the replaceOne function.
To update an existing document in mongoose collection, we use replaceOne. When replaceOne is used, the field which was already encrypted in the document is replaced with an actual field value (i.e. the field stays unencrypted).
In the documentation of mongoose-field-encryption, there is no information w.r.t replaceOne. Could you give us some insights regarding this?
The text was updated successfully, but these errors were encountered: