Skip to content

Update examples/statics/statics.js#15737

Merged
vkarpov15 merged 1 commit intoAutomattic:masterfrom
Gautam-Bharadwaj:master
Nov 13, 2025
Merged

Update examples/statics/statics.js#15737
vkarpov15 merged 1 commit intoAutomattic:masterfrom
Gautam-Bharadwaj:master

Conversation

@Gautam-Bharadwaj
Copy link
Copy Markdown
Contributor

Summary

Update examples/statics/statics.js to replace the deprecated Person.remove() call in the cleanup() function with Person.deleteMany().
The remove() API was removed in Mongoose 7+, causing the example to throw a runtime error.
This change ensures compatibility with Mongoose 7 and 8.

Examples

Before:

await Person.remove();

@vkarpov15 vkarpov15 added this to the 8.19.4 milestone Nov 13, 2025
Copy link
Copy Markdown
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 merged commit a99ec8a into Automattic:master Nov 13, 2025
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