Hello I am programming an app in android studio and i use firebase functions to delete all userdata when the USER gets deleted. Here in the photo when "asdf" from "USER" gets deleted the ID "asdf" should get deleted everywhere. This following code works fine but only if the ID isnt in the the directory of a unknown ID.
exports.deleteAdd1 = functions.database.ref('/USER/{userId}').onDelete((snap, context) => {
const userId = context.params.userId;
return admin.database().ref("/Add").child(userId).remove();
});
I really dont know how to delete the "asdf" under "Add" and another ID ...like in the picture (the ID "5wIddHUoJy" is unknown) Please help!