Summary
The JSON editor removes _id then $sets the remaining map. Fields the user deleted in JSON remain in the document. Nested replacements also cannot drop keys.
Scope
- Persist via replaceOne (whole document except
_id) or compute $unset for keys present in the original and absent in the edited JSON.
- Keep
_id immutable.
- Test: start
{a:1,b:2}, save {a:1} → b is gone.
Out of scope
- Inspector single-field
$set (correct for that path).
Summary
The JSON editor
removes_idthen$sets the remaining map. Fields the user deleted in JSON remain in the document. Nested replacements also cannot drop keys.Scope
_id) or compute$unsetfor keys present in the original and absent in the edited JSON._idimmutable.{a:1,b:2}, save{a:1}→bis gone.Out of scope
$set(correct for that path).