Auto deletion of related czml entities?

I know that I can use a reference value in czml to link a single property on multiple entities in cesium but, is there an easy way to make it so that, if I have multiple that are all related and I delete one that is considered the “parent” that it would delete children that consider it the parent as well?

Or could I automate that by watching events on the datasource and remove the items that have it as their parent? I also don’t see in the docs, that you can set a parent on an czml entity. Does that exist? I know you can using raw entities, set one as the parent of another but the value is an actual entity. For this, czml would have to receive the parent id as a string and make that association for me.

UPDATE: After digging and testing some stuff, I found several things that may help. So, in czml, I didn’t really see it in the docs anywhere but you can in fact set a parent. It’s just the string id of the other entity that should be the parent. That works. Next, I could add a collectionChanged event listener to the entity collection and watch for when an entity is removed. Another thing I don’t see documented though is that the entity has a _children prop that’s an array. If an entity is aware of it’s children, shouldn’t removing it auto remove it’s children? Or at least be an option when deleting with czml or deleting an entity, to remove it’s children? That seems like a nice addition.

This post is still relevant: How to remove children entities when a parent entity is removed for the _children prop array.

It’s currently possible to show and hide entities by hiding their parent. The same case is not true for removing entities.

For now I’ve just added an event listener to my czml data source and watch for the deletions there. If something is removed, I check that entity to see if it has children and delete those as well. It works for the time being. I was just suggesting that, that would be a nice thing to add to czml is, make it so I pass a prop when I { id, delete:true } to have another prop I can set to tell it to delete children too