Recently I created a firebase functions code which triggers when certain document is deleted in Firestore. It works perfectly fine when I am deleting the document programmatically, but it does not work when I am deleting the document from Firebase Console.
Actually I also have sub-collection inside the document which I need even if the document data is deleted. So from firebase console I cannot 'Delete document' but I need to 'Delete document fields' which will prevent deleting my sub-collections.
Also when I delete a document with sub-collection programmatically, it deletes only the document fields and not the entire document with sub-collections. So why is onDelete triggered when deleting document programmatically but not when deleting document fields from firebase console. The 1st picture is the document which was deleted programmatically and 2nd one is the one I deleted from firebase console.
What should I do to trigger onDelete firebase function when deleting document manually from Firebase Console without deleting sub-collections ?