Problem: data 2
_idField in data 1
friendsField, at this time I want to delete data 2, but
_idThe field was not deleted.
Question: after deleting data 2, all the
_idAre automatically deleted.
If it can’t be deleted automatically, it means that I have to query again and delete it??
Baidu a circle, did not find the answer, should be I did not catch the keyword.. So I came here to ask.. Daniel, help me.
MongoDBYou need to query and delete by yourself. Maybe in order to delete quickly, you may also need to record the relationship in reverse.
MongoDB has no cascading deletes. When your application deletes data, it is also responsible for removing any referenced objects itself and any references to the deleted document.
Mongodb has no cascading deletions. When the application needs to delete data, the application itself is responsible for removing any references related to the deleted data.
Thank you very much.