Deleting a User and all the Links in the DB

First off I am using mongoose

Assumption: If a user deletes their account I should remove everything from them off the DB.


X = deleted (I think)

User1 X /Users : reference to: profileThumbnail X, userRecipes X, userReviews X, favPosts X

Recipes : reference to: postImages X, recipeReviews X

Reviews X : reference to: authorUser

I am wondering if this seems like enough to erase everything from the DB.

Make controller: ( delete favPosts from all Users profiles → delete recipeReviews on all Recipes → delete all Reviews of User1 → Delete all postImages on posts from User1 from API → delete all userRecipes of user1 → delete profileThumbnail from API → delete user1 from DB)

I am thinking this order should delete everything from the DB from that user and also from my picture API. Is there an easier way to do this? This is my first time doing something so complex so any input is appreciated.

This is how I delete recipes :

module.exports.deleteRecipe = async (req, res, next) => {
const { id } = req.params;
await User.updateMany({}, { $pull: { recipes: id, savedRecipes: id } });
const recipe = await Recipes.findById(id); (element) => {
await User.updateMany({}, { $pull: { reviews: element } });
const deletedRecipe = await Recipes.findByIdAndDelete(id);
  req.flash("success", "Your recipe was deleted.");