Skip to content

fix(mongo): fail update/delete when 0 documents match - #864

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/776-mongo-zero-match
Sep 20, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/776-mongo-zero-match

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

  • `updateOne` / `replaceOne` / `deleteOne` throw when `nMatched` / `nRemoved` is 0 (wrong `_id` type, deleted doc).
  • Inspector and JSON editor already catch that as Save Failed. Identical `$set` (`nModified == 0`) still counts as a match.

Closes #776

Test plan

  • Save a Mongo field after deleting the document elsewhere → inspector shows the 0-match error, not success
  • JSON editor Save with a stale `_id` → Failed to save, not Document saved successfully
  • Save the same value again (`nModified == 0`) still succeeds
  • Delete of an already-deleted document errors instead of silently succeeding

@github-actions github-actions Bot added bug Something isn't working error-handling Theme parser epic label: error-handling backend Backend database driver execution and queries labels Sep 20, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 0e8d53b into dev Sep 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend database driver execution and queries bug Something isn't working error-handling Theme parser epic label: error-handling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant