-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Creating array discriminators only takes two parameters? #8164
Labels
docs
This issue is due to a mistake or omission in the mongoosejs.com documentation
Milestone
Comments
Good suggestion, will fix. |
vkarpov15
added
the
enhancement
This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
label
Sep 23, 2019
You going to update the documentation as well? ;-) |
I don't think we have docs for this yet, but that's definitely something to add for the future |
vkarpov15
added
docs
This issue is due to a mistake or omission in the mongoosejs.com documentation
and removed
enhancement
This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
labels
Oct 1, 2019
This was referenced Mar 11, 2021
Open
This was referenced Mar 18, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you create an array discriminator, you do something like this:
var Clicked = docArray.discriminator('Clicked', clickedSchema);
But if you do a model discriminator you can add a third parameter to specify the discriminator key value:
var Clicked = Event.discriminator('Clicked', clickedSchema, "clicked");
Just wondering why we can't use a 3rd discriminator key parameter when we use array discriminators? I'm assuming the first parameter is still the model name, so it would be nice to have the ability to specify the key value if you want it to be different from the Model name.
Thanks!
The text was updated successfully, but these errors were encountered: