-
-
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
Add "required" flag to discriminator model's nested property #10157
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Comments
|
IslandRhythms
added
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
labels
Apr 19, 2021
I've been digging into this and confirmed this is a bug. It looks like it is due to the |
vkarpov15
added a commit
that referenced
this issue
Apr 28, 2021
vkarpov15
removed
the
has repro script
There is a repro script, the Mongoose devs need to confirm that it reproduces the issue
label
Apr 29, 2021
Wow I didn't expect a fix so soon. Thank you for your hard work! 🥇 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you want to request a feature or report a bug?
Potential bug
My Problem
I want my discriminated model to have a
required
flag onname.firstName
, but my base model should not.What is the current behavior?
Given the following code snippet:
What are the versions of Node.js, Mongoose and MongoDB you are using?
Node 15.14.0, mongoose 5.12.3, MongoDB 4.4.4 Community
It looks like the
title
'srequired
flag in myvipSchema
is working just fine, but onfirstName
it is somehow ignored. Im wondering if this is the expected behaviour of mongoose and if so, how else am I supposed to add therequired
flag to my discriminator model?The text was updated successfully, but these errors were encountered: