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(schema): copy indexes when calling add() with schema instance #12737

Merged
merged 1 commit into from Nov 30, 2022

Conversation

vkarpov15
Copy link
Collaborator

Fix #12654

Summary

Docs say that Schema.prototype.add() copies indexes if you call add() with a schema instance, but looks like that doesn't actually happen. I can see the case for putting this change in a minor release, but I think patch is fine since the docs indicate that this is the correct behavior.

Examples

Copy link
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! 👍

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

@vkarpov15 vkarpov15 merged commit d2a8e8e into master Nov 30, 2022
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-12654 branch November 30, 2022 16:20
rdeavila94 added a commit to rdeavila94/mongoose that referenced this pull request Mar 6, 2023
…ticgh-12654

fix(schema): copy indexes when calling `add()` with schema instance
vkarpov15 added a commit that referenced this pull request Mar 6, 2023
Merge pull request #12737 from Automattic/vkarpov15/gh-12654
@raj-goguardian raj-goguardian mentioned this pull request Mar 22, 2023
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.

Schema.add method doesn't copy indexes
3 participants