Deleting a document whose _id is a reference in another collection causes documents in the other collection to be deleted

My apologies. I lost track of this one. I’ll extract the code here and see what’s happening.