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

docs(discriminators): add section about changing discriminator key #12861

Merged
merged 1 commit into from Jan 6, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #6087

Summary

Add overwriteDiscriminatorKey to discriminator docs, because that option is a bit hard to find.

Examples

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

to your schemas that it uses to track which discriminator
this document is an instance of.
The way Mongoose tells the difference between the different discriminator models is by the 'discriminator key', which is `__t` by default.
Mongoose adds a String path called `__t` to your schemas that it uses to track which discriminator this document is an instance of.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this meant to be on the same line? (previous line is missing double spaces to make it a new line)

@vkarpov15 vkarpov15 merged commit 426cc8c into master Jan 6, 2023
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-6087 branch January 6, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add discriminator key to findOneAndUpdate
2 participants