-
Notifications
You must be signed in to change notification settings - Fork 392
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
Support multi
update
's argument
#790
Conversation
Codecov Report
@@ Coverage Diff @@
## main #790 +/- ##
==========================================
- Coverage 62.51% 62.45% -0.07%
==========================================
Files 231 231
Lines 10798 10810 +12
==========================================
+ Hits 6750 6751 +1
- Misses 3273 3284 +11
Partials 775 775
Flags with carried forward coverage won't be shown. Click here to find out more. |
I think they use |
Updated the test case to use Now the behavior is the same when testing from the go driver and mongosh: |
Also added a test case to fallback to true in case it's not present
cdc7b29
to
56fc5b7
Compare
Rebased from new |
Ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May you also port those changes to tigris/msg_update.go
. No tests are necessary for that handler yet
@GinGin3203 PTAL if you have a moment :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look correct to me, but maybe I just don't understand something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes #486
This PR accepts the additional optional flag for multiple updates straight on the
update
command:https://www.mongodb.com/docs/manual/reference/method/db.collection.update/#std-label-update-multi
Since there is no high level API to call update (only UpdateOne or UpdateMany), I added a test that uses the lower levelRunCommand
API, providing the expected update command payload document.My strategy on this particular test was to add two documents with a same field (
x: 1
) and then update usingmulti: false
UpdateOne
first, and checking that only the first document was updated; and then update usingmulti: true
UpdateMany
making sure both documents were modified.Checklist
task all
passes.See CONTRIBUTING.md for more details.