Skip to content
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

fix: allow nested schemas on discriminated models to work #43

Merged

Conversation

DesignByOnyx
Copy link

Summary

This allows nested schemas on discriminated models to work (closes #42). While implementing the fix, I was able to rip out a lot of unnecessary code. I did not intend on such a refactor, but the resulting code feels much cleaner and doesn't need to worry about projection. I ran the tests against mongoose 7.7.0, 8.5.0, and 8.5.1.

Examples

Please see the test code and code referenced in the open issue #42.

@DesignByOnyx
Copy link
Author

Apologies for bombarding you guys with a bunch of issues and PRs on this repo. All of the contributions I've made have come from a real project which is used for some really big companies. I've been upgrading our codebase from mongoose 6 to mongoose 8, and this package from 0.4.0 to 2.1.0. I had the bandwidth to make these changes and have written tests and tested it in a real-world app.

All of my PRs will close every open issue on this repo, and I am actively using all of these changes in our project.

I would love to get these changes merged so that we don't have to maintain our own fork (and so that you don't encounter these issues from other users). Please let me know what I can do to push these along. I'm able and willing to address any feedback.

Copy link
Member

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is very helpful, thanks, just has some merge conflicts that we will clean up in master after merging because it's easier to make changes locally vs GitHub.

@vkarpov15 vkarpov15 merged commit cefc3e6 into mongoosejs:master Feb 21, 2025
0 of 3 checks passed
vkarpov15 added a commit that referenced this pull request Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not work on nested schemas on discriminated models
2 participants