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: update documentation of custom _id overriding in discriminators #8591

Merged
merged 1 commit into from
Feb 14, 2020

Conversation

sam-mfb
Copy link
Contributor

@sam-mfb sam-mfb commented Feb 13, 2020

Summary

This fixes Issue 8588 which appears to be an artifact in the documentation from before this fix to how the discriminator code handled a custom _id in the base schema. As I understand it, in the old code the implicit discriminator schema would still override the base, unless _id was set to 'false' in the discriminator options. This is what the old documentation still reflects (at least in part). However, it appears that now a custom base _id always overrides the discriminator _id. This updates the documentation to reflect that behavior.

Examples

This is a test file. The tests still run correctly--it was just the descriptions that didn't match.

@sam-mfb sam-mfb marked this pull request as ready for review February 13, 2020 16:30
@sam-mfb sam-mfb requested a review from vkarpov15 February 13, 2020 16:37
Copy link
Collaborator

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

Thanks!

@vkarpov15 vkarpov15 added this to the 5.9.1 milestone Feb 14, 2020
@vkarpov15 vkarpov15 added the docs This issue is due to a mistake or omission in the mongoosejs.com documentation label Feb 14, 2020
@vkarpov15 vkarpov15 merged commit 8ea5e98 into Automattic:master Feb 14, 2020
@sam-mfb sam-mfb deleted the fix-8588 branch February 14, 2020 19:34
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

Successfully merging this pull request may close these issues.

2 participants