Delete document and all sub-documents

There are 2 collections (collection and subcollection or 2 different collections, 2 different collections are better):
- entries
- subentries
Relationships: 1 to Many

If the user deletes an entry then all of its subentries should be deleted too.
I guess such logic:
1) Backend call - Firebase - Delete Document
2) Loop Actions
3) For each item delete document where entry_id = /this id/.

A. How to define documents on step 3?
B. Is it necessary to use loop actions or is there any way?
C. Please give me a short algorithm.

4 replies