nkohari/stash — Issue #1: Deleting a parent key results in orphaned keys.
Author: mintplant
Created: 2012-03-04 03:08:40+00:00
State: open

Say I have a structure where `post1` is dependent on `comment1`, `comment2`, and `comment3`.
- If I delete `post1`, I'd want to also get rid of `comment1`, `comment2`, and `comment3`, as they would no longer be used. But instead, here, they'd linger on, unneeded, clogging up my Stash.
- However, if, somehow, a `post2` also depended on `comment1`, I'd want to *not* delete it along with `post1`, as long as something still referenced it.

My idea would be to mark certain entities as *delete-if-not-referenced*, and, when an entity depending on them is deleted/invalidated, they would also be removed. Not sure if that'd be the best way to go about this, though.