maritz / nohm

node.js object relations mapper (orm) for redis
http://maritz.github.io/nohm/
MIT License
500 stars 64 forks source link

does relationship supports cascade deleting? #136

Closed fatfatson closed 6 years ago

fatfatson commented 6 years ago

it seems the foreign objects and their relation keys are left after the primary object has deleted, is this the right result now?

maritz commented 6 years ago

When you remove() on an instance, all its relations should also be removed. However the foreign objects remain, yes.

Example:
If you have a Car instance that is related to a Manufacturer instance, removing a car instance won't remove the manufacturer but it should remove the relation from that specific car model to that manufacturer.

If you can provide some more information about which cases leave relation keys intact, that would be great. There are some tests for it, but possibly not enough.

maritz commented 6 years ago

@fatfatson I'm assuming the problem is resolved.

If not, please re-open the issue. :-)