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(query): remove count() and findOneAndRemove() from query chaining #14692

Merged
merged 11 commits into from
Jul 1, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14689

Summary

A bit of an unfortunate case where mquery still supports count() and findOneAndRemove(), which means you can still access those functions in Mongoose 8 with query chaining. This PR removes that.

Examples

vkarpov15 and others added 11 commits June 24, 2024 10:15
…cs get fully validating if they're directly modified

Fix #14677
fix(document): avoid passing validateModifiedOnly to subdocs so subdocs get fully validating if they're directly modified
fix(projection): handle projections on arrays in `Model.hydrate()` projection option
fix: handle casting primitive array with $elemMatch in bulkWrite()
types(connection): fix return type of withSession()
@vkarpov15 vkarpov15 added this to the 8.5 milestone Jun 25, 2024
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, do we need to modify the TS declarations for this as well?

@hasezoey
Copy link
Collaborator

hasezoey commented Jul 1, 2024

do we need to modify the TS declarations for this as well?

to my knowledge that has already been removed, the only mentions about count in the types are about $count and aggregate.count() (and estimatedDocumentCount)

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.

Query.count / Query.findOneAndRemove are still alive
5 participants