Removing nested scriptable object

Is there a way to remove a nested scriptable object from a parent scriptable object asset?

I have added the nested scriptable object to the parent asset with: AssetDatabase.AddObjectToAsset(nestedSO, parentSO) …

… and I can see that it is properly persisted to the asset in YAML, but I cannot find a way to remove that nestedSO when needed.

Any ideas?

Found it!

The answer is to use DestroyImmediate: Unity - Scripting API: Object.DestroyImmediate

Like: UnityEngine.Object.DestroyImmediate(nestedSO, true);

And then proceed as usual marking the corresponding SOs as dirty and save the asset datatbase.