-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recompiling schema does not reapply discriminators #14444
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Comments
IslandRhythms
added
the
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
label
Mar 21, 2024
Labeling as bug, but could be feature request. Docs are unclear. |
vkarpov15
added a commit
that referenced
this issue
Apr 4, 2024
vkarpov15
added a commit
that referenced
this issue
Apr 7, 2024
fix(model): make `Model.recompileSchema()` also re-apply discriminators
This was referenced May 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Mongoose version
8.2.2
Node.js version
18.16
MongoDB server version
6.3.0
Typescript version (if applicable)
No response
Description
I have a use case where I define a schema that uses a discriminated schema in a base package. I want to enable dependent packages to add their own implementations of the discriminated schema. However, it seems that once the model that uses the schema is compiled, adding further discriminated schemas are not applied.
Steps to Reproduce
Expected Behavior
After recompiling a schema, it should also apply new discriminators of its fields.
The text was updated successfully, but these errors were encountered: