question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Removing non-existent intermediate sub-key should not throw an exception

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bfink13commented, Apr 17, 2019

Yep 😃 Found one more weird case that I’m trying to iron out…

1reaction
bfink13commented, Apr 17, 2019

Yep, working on it as we speak.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found