views:

31

answers:

1

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?

+1  A: 

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

http://jira.mongodb.org

shingara
I posted a feature request on jira, thnx for the tip ;)
VDVLeon
so you can up-vote the answer :)
shingara
yeah, srry, i forgot because i had to leave my pc at that moment :P
VDVLeon