Removing non-existent intermediate sub-key should not throw an exception
See original GitHub issueThe current behavior for removing a sub-key is this:
Object subObject = getFieldValueListSafe(document, mainKey);
if (subObject instanceof Document || subObject instanceof List<?>) {
return removeSubdocumentValue(subObject, subKey, matchPos);
} else {
throw new MongoServerException("failed to remove subdocument");
}
With the code above, if an intermediate sub-key is missing, an exception will be thrown. It is perfectly reasonable that an intermediate sub-key does not exist on the document in question. If it doesn’t, the operation (remove or rename) should be ignored for that document.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
teams failed - Microsoft Community
ArgumentException : Cannot delete a subkey tree because the subkey does not exist. at System.ThrowHelper.ThrowArgumentException(ExceptionResource ...
Read more >vb.net - Can't remove value in registry - Stack Overflow
I'm getting an error: "Value does not exist"... But the value exists in my registry. How do i delete the value ( but...
Read more >Deploying Malwarebytes Via GPO
I navigated to Control Panel > Windows Firewall > Advanced Settings > Outbound and created a New Rule with port 443, but I...
Read more >Access Denied / Unknown Error / other issues when running ...
Let's say I delete the problem folder. Everything works fine for a few days, but eventually I will not be able to launch...
Read more >PSAppDeployToolkit/AppDeployToolkitMain.ps1 at master
This is an internal script function and should typically not be called directly. ... If the system mutex does not exist, this method...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep 😃 Found one more weird case that I’m trying to iron out…
Yep, working on it as we speak.