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

Support findAndModify #548

Merged
merged 104 commits into from
May 23, 2022
Merged

Conversation

w84thesun
Copy link
Contributor

@w84thesun w84thesun commented May 2, 2022

Closes #164.

@w84thesun w84thesun added code/feature Some user-visible feature is not implemented yet trust PRs that can access Actions secrets labels May 2, 2022
@w84thesun w84thesun self-assigned this May 2, 2022
@codecov
Copy link

codecov bot commented May 2, 2022

Codecov Report

Merging #548 (3045a58) into main (638e107) will increase coverage by 1.47%.
The diff coverage is 80.06%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #548      +/-   ##
==========================================
+ Coverage   61.80%   63.28%   +1.47%     
==========================================
  Files         122      122              
  Lines        6928     7157     +229     
==========================================
+ Hits         4282     4529     +247     
+ Misses       2121     2081      -40     
- Partials      525      547      +22     
Impacted Files Coverage Δ
internal/handlers/common/error.go 84.48% <ø> (ø)
internal/handlers/common/errorcode_string.go 80.00% <ø> (ø)
internal/handlers/pg/msg_insert.go 40.90% <40.00%> (-3.54%) ⬇️
internal/handlers/pg/msg_update.go 48.93% <70.00%> (+0.04%) ⬆️
internal/handlers/pg/msg_delete.go 46.00% <76.19%> (+0.25%) ⬆️
internal/handlers/pg/msg_findandmodify.go 78.73% <83.03%> (+78.73%) ⬆️
internal/handlers/common/params.go 90.69% <100.00%> (+2.12%) ⬆️
internal/types/types.go 85.88% <0.00%> (+2.35%) ⬆️
internal/handlers/common/limit.go 75.00% <0.00%> (+8.33%) ⬆️
Flag Coverage Δ
FerretDB 57.39% <80.06%> (+1.71%) ⬆️
MongoDB 6.29% <1.30%> (-0.16%) ⬇️
integration 57.42% <80.06%> (+1.71%) ⬆️
unit 25.09% <1.30%> (-0.81%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@AlekSi AlekSi added this to the v0.2.1 milestone May 3, 2022
AlekSi and others added 9 commits May 4, 2022 09:57
…erretDB#555)

Bumps [go.mongodb.org/mongo-driver](https://github.com/mongodb/mongo-go-driver) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/mongodb/mongo-go-driver/releases)
- [Commits](mongodb/mongo-go-driver@v1.9.0...v1.9.1)

---
updated-dependencies:
- dependency-name: go.mongodb.org/mongo-driver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
w84thesun added 2 commits May 17, 2022 00:37
@AlekSi AlekSi modified the milestones: v0.2.1, v0.3.0 May 17, 2022
@seeforschauer
Copy link
Contributor

some checks (i.e. inclusion/exclusion) of user input are in $elemMatch PR #551.

Copy link
Contributor

@seeforschauer seeforschauer left a comment

Choose a reason for hiding this comment

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

Would you please add more tests,

  • Cannot specify both an update and remove=true
  • Cannot specify both upsert=true and remove=true
  • Cannot specify both new=true and remove=true; 'remove' always returns the deleted document
  • Cannot specify arrayFilters and remove=true
  • Cannot specify arrayFilters and a pipeline update

Thank you.

@w84thesun
Copy link
Contributor Author

Thanks, I've missed those checks.

  • Cannot specify arrayFilters and remove=true
  • Cannot specify arrayFilters and a pipeline update

I don't sure we support arrayFilters right now. Although we definitely don't support pipeline updates.

I've added other 3 tests.

@seeforschauer
Copy link
Contributor

Thank you!

I don't sure we support arrayFilters right now. Although we definitely don't support pipeline updates.

Maybe mention somewhere in the issue description that the findAndModify is supported w/o arrayFilters and pipeline updates?

@w84thesun
Copy link
Contributor Author

Thank you!

I don't sure we support arrayFilters right now. Although we definitely don't support pipeline updates.

Maybe mention somewhere in the issue description that the findAndModify is supported w/o arrayFilters and pipeline updates?

arrayFilters are already mentioned in the issue and marked as unimplemented.

@AlekSi AlekSi requested review from a team and removed request for a team May 18, 2022 09:57
@w84thesun w84thesun merged commit d80126f into FerretDB:main May 23, 2022
@w84thesun w84thesun deleted the issue-164-find-and-modify branch May 23, 2022 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/feature Some user-visible feature is not implemented yet trust PRs that can access Actions secrets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support findAndModify
3 participants