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
As can be seen in the minimal reproduction here, when a schema and its subdoc both have transforms defined, the top-level transform is used for the subdoc as well.
In the gist I also included a workaround, as all actual fixes to mongoose I tried broke a bunch of tests. In my opinion this problem is caused by Document.prototype.toObject actually changing the options object. If anything it should change a clone, but that breaks a bunch of tests right now.
The text was updated successfully, but these errors were encountered:
As can be seen in the minimal reproduction here, when a schema and its subdoc both have transforms defined, the top-level transform is used for the subdoc as well.
Expected output:
Actual output:
In the gist I also included a workaround, as all actual fixes to mongoose I tried broke a bunch of tests. In my opinion this problem is caused by Document.prototype.toObject actually changing the options object. If anything it should change a clone, but that breaks a bunch of tests right now.
The text was updated successfully, but these errors were encountered: