I want to write a recursive function in which I can pass in a document reference and delete that document and it's subcollections. I was thinking that the base case would be that the document has no subcollections. If it has a subcollection, I would pass that subcollection into the recursive function, and delete any existing documents. If not, I would simply delete that document and return. So is there someway I can check if a document has a subcollection, and if so retrieve it?
            Asked
            
        
        
            Active
            
        
            Viewed 829 times
        
    1 Answers
0
            
            
        According to Doug Stevenson here there are no client SDK APIs for listing subcollections of a document.
Although you may find your answer here but that also may create further problems. In documentation also deleting collections from an Android client is not recommended.
        Ashish Yadav
        
- 543
 - 2
 - 7
 - 30
 
- 
                    Did you find the answer or any other workaround? If not, please accept the answer and upvote it so that others will get benefit too. – Ashish Yadav Aug 16 '18 at 08:47