Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB DBRef ON DELETE CASCADE

Is there a way in MongoDB to have a foreign key with a 'ON DELETE CASCADE' functionality?

I know you can use DBRef as a sort of foreign key but when the item in a collection where the reference points to is removed, the reference returns null. But i want that the item where the reference belongs to gets removed. How do i do this?

Or do i need every time i remove things check references to it?

like image 412
VDVLeon Avatar asked Jun 25 '10 02:06

VDVLeon


1 Answers

This feature doesn't exist now. If you want it. Add it on MongoDB Bugtracker

http://jira.mongodb.org

like image 198
shingara Avatar answered Sep 25 '22 23:09

shingara