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

Do not return immutable _id error from findAndModify for upserting same _id #3171

Merged

Conversation

chilagrow
Copy link
Member

@chilagrow chilagrow commented Aug 8, 2023

Description

Closes #2803.

Readiness checklist

  • I added/updated unit tests (and they pass).
  • I added/updated integration/compatibility tests (and they pass).
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@chilagrow chilagrow added the code/bug Some user-visible feature works incorrectly label Aug 8, 2023
@chilagrow chilagrow self-assigned this Aug 8, 2023
@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Merging #3171 (3b8b643) into main (cdd2f82) will decrease coverage by 3.66%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3171      +/-   ##
==========================================
- Coverage   75.41%   71.76%   -3.66%     
==========================================
  Files         396      396              
  Lines       22202    22210       +8     
==========================================
- Hits        16744    15939     -805     
- Misses       4472     5229     +757     
- Partials      986     1042      +56     
Files Changed Coverage Δ
internal/handlers/common/findandmodify.go 62.70% <100.00%> (-14.14%) ⬇️

... and 68 files with indirect coverage changes

Flag Coverage Δ
hana ?
integration 67.64% <100.00%> (-4.18%) ⬇️
mongodb 5.30% <0.00%> (-0.01%) ⬇️
pg 60.40% <100.00%> (-4.81%) ⬇️
shard-1 56.43% <0.00%> (-0.11%) ⬇️
shard-2 27.77% <0.00%> (-27.61%) ⬇️
shard-3 55.11% <100.00%> (-0.19%) ⬇️
sqlite 33.06% <0.00%> (-3.08%) ⬇️
unit 24.67% <0.00%> (-0.01%) ⬇️

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

@chilagrow chilagrow changed the title Remove immutable _id check from findAndModify upsert option Return immutable _id error from findAndModify for upsert different _id Aug 8, 2023
@chilagrow chilagrow changed the title Return immutable _id error from findAndModify for upsert different _id Do not return immutable _id error from findAndModify for upserting same _id Aug 8, 2023
@chilagrow chilagrow marked this pull request as ready for review August 8, 2023 09:50
@chilagrow chilagrow requested a review from a team as a code owner August 8, 2023 09:50
@chilagrow chilagrow requested a review from rumyantseva August 8, 2023 09:50
@chilagrow chilagrow enabled auto-merge (squash) August 8, 2023 09:50
@chilagrow chilagrow requested review from a team and noisersup August 8, 2023 09:50
noisersup
noisersup previously approved these changes Aug 8, 2023
Copy link
Member

@noisersup noisersup left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

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

LGTM

@chilagrow chilagrow merged commit 74844b1 into FerretDB:main Aug 10, 2023
@AlekSi AlekSi added this to the v1.8.0 milestone Aug 14, 2023
yonarw pushed a commit to yonarw/FerretDB that referenced this pull request Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/bug Some user-visible feature works incorrectly
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Error updating a document passing its same id with the $set operator
4 participants