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
The problem starts with version 8.8.3 and is still there in 8.8.4 and 8.9. In my case the supdocuments with discriminators don't get the modified date updated.
Prerequisites
Mongoose version
8.8.4
Node.js version
22.12.0
MongoDB server version
8.0.3
Typescript version (if applicable)
No response
Description
Hi, it seems, that hooks of embedded documents aren't triggered properly when used with discriminators. I wrote very simple example to reproduce.
Steps to Reproduce
Document.js
Subdocument.js:
Discriminator.js:
Test.js
Expected Behavior
When saving either Document or Discriminator, the Subdocument hook should be triggered. The expected output is:
However, when saving the Discriminator, the Subdocument hook is not triggered. The actual output is:
The text was updated successfully, but these errors were encountered: