-
-
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. |
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 |
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: