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

add array filter with apply #267

Merged
merged 4 commits into from
Jan 20, 2023

Conversation

xsean2020
Copy link
Contributor

add array filter with apply

query.go Outdated
@@ -405,6 +405,10 @@ func (q *Query) findOneAndUpdate(change Change, result interface{}) error {
opts.SetReturnDocument(options.After)
}

if change.ArrayFilters != nil {
opts.ArrayFilters = change.ArrayFilters
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use SetArrayFilters() would be better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update With SetArrayFilters

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mean

	if q.arrayFilters != nil {
		opts.ArrayFilters = q.arrayFilters
	}

should be

	if q.arrayFilters != nil {
		opts. SetArrayFilters(q.arrayFilters)
	}

@jiangz222 jiangz222 merged commit 71ef4a2 into qiniu:master Jan 20, 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.

2 participants