MongoDB DBRef ON DELETE CASCADE

随声附和 提交于 2019-11-29 17:43:41

问题


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:


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

http://jira.mongodb.org



来源:https://stackoverflow.com/questions/3115261/mongodb-dbref-on-delete-cascade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!