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(model): skip createCollection() in syncIndexes() if autoCreate: false #15155

Merged
merged 3 commits into from
Jan 4, 2025

Conversation

vkarpov15
Copy link
Collaborator

Summary

autoCreate is supposed to skip implicit createCollection() calls, but syncIndexes() still sends a createCollection() even if autoCreate is disabled.

The potential issue with automatic createCollection() is calling createCollection() unnecessarily on every server restart (presuming the user calls syncIndexes() on every server restart) is wasteful and may cause slight performance degradation.

Will put this in 8.10 in the interest of being cautious.

Examples

fix(schema): allow multiple self-referencing discriminator schemas using Schema.prototype.discriminator
@vkarpov15 vkarpov15 added this to the 8.10 milestone Jan 3, 2025
@vkarpov15 vkarpov15 changed the base branch from master to 8.10 January 4, 2025 18:26
@vkarpov15 vkarpov15 merged commit 911ba54 into 8.10 Jan 4, 2025
74 checks passed
@hasezoey hasezoey deleted the vkarpov15/autocreate-syncindexes branch January 5, 2025 09:44
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.

2 participants