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 counts in WriteResult for upsert operation #1412

Merged
merged 1 commit into from Oct 24, 2022

Conversation

dparamoshkin
Copy link
Contributor

@dparamoshkin dparamoshkin commented Oct 24, 2022

This PR fixes insert counters for the upsert operation described in #1376 Mongo doesn't provide it as insertedCount, but it could be get from the size of upserts collection

@dparamoshkin
Copy link
Contributor Author

@asereda-gs I made some changes based on your fix, hope it could be merged to the project

@asereda-gs asereda-gs merged commit b511f4e into immutables:master Oct 24, 2022
@asereda-gs
Copy link
Member

Thanks for this PR!

@asereda-gs
Copy link
Member

Now when I think, perhaps WriteResultTest can be shared among multiple backends.

Take a look at WriteTemplate. Maybe something similar can be created (eg. called WriteResultTemplate) and applied to all backends which support returning write counts ?

@dparamoshkin is it something you might be interested to implement ?

@asereda-gs
Copy link
Member

Or another option is to enhance WriteTemplate by checking WriteResult of different operations (if counts are present).

@dparamoshkin
Copy link
Contributor Author

@asereda-gs I would check on weekend if I can improve something there

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.

None yet

2 participants