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

Creating array discriminators only takes two parameters? #8164

Closed
chaeron opened this issue Sep 14, 2019 · 3 comments
Closed

Creating array discriminators only takes two parameters? #8164

chaeron opened this issue Sep 14, 2019 · 3 comments
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Milestone

Comments

@chaeron
Copy link

chaeron commented Sep 14, 2019

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!

@vkarpov15
Copy link
Collaborator

Good suggestion, will fix.

@vkarpov15 vkarpov15 added this to the 5.7.2 milestone Sep 19, 2019
@vkarpov15 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
@chaeron
Copy link
Author

chaeron commented Sep 26, 2019

You going to update the documentation as well? ;-)

@vkarpov15
Copy link
Collaborator

I don't think we have docs for this yet, but that's definitely something to add for the future

@vkarpov15 vkarpov15 reopened this Oct 1, 2019
@vkarpov15 vkarpov15 modified the milestones: 5.7.2, 5.x Unprioritized Oct 1, 2019
@vkarpov15 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
@vkarpov15 vkarpov15 modified the milestones: 5.x Unprioritized, 5.7.6 Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Projects
None yet
Development

No branches or pull requests

2 participants