Skip to content

fix: remove _id from replacement doc in repository update methods#166

Merged
Azfe merged 6 commits into
mainfrom
develop
May 5, 2026
Merged

fix: remove _id from replacement doc in repository update methods#166
Azfe merged 6 commits into
mainfrom
develop

Conversation

@Azfe
Copy link
Copy Markdown
Owner

@Azfe Azfe commented May 5, 2026

MongoDB's replace_one raises a BSONError when the replacement document includes an _id field with a different type than the stored document (e.g. string vs ObjectId). Strip _id from the doc before replacing so the filter alone identifies the target document.

  MongoDB's replace_one raises a BSONError when the replacement document
  includes an _id field with a different type than the stored document
  (e.g. string vs ObjectId). Strip _id from the doc before replacing
  so the filter alone identifies the target document.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Azfe Azfe merged commit 75d33b6 into main May 5, 2026
13 checks passed
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.

1 participant