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(cursor): handle calling skipMiddlewareFunction() in pre('find') middleware with cursors #13436

Merged
merged 2 commits into from May 24, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #13411

Summary

Currently, skipMiddlewareFunction() in pre('find') middleware causes an error if you're using cursors. With this change, it is now fine to call skipMiddlewareFunction() in pre('find') middleware with cursors with no parameters; or with null, undefined, or empty array [].

The reason why we don't support passing an array of documents is that it would be tricky to rewrite current cursor logic to use arrays. We may consider this for the future if there's demand.

Examples

Copy link
Collaborator

@IslandRhythms IslandRhythms left a comment

Choose a reason for hiding this comment

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

Probably gonna have merge conflicts with my PR regarding cursors.

Edit: Didn't realize you merged it already.

@vkarpov15 vkarpov15 merged commit 762254d into master May 24, 2023
34 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-13411 branch May 24, 2023 20:25
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.

@vkarpov15 skipMiddlewareFunction only works for Query not QueryCursor, here is an example
3 participants