Please take a look at this example:

As you see I have a collection called "new_letters" and inside there I have documents, which also have collections and in those also documents, so basicly a long chain of data segments always.
My goal would be to have a listener which checks the amount of documents inside of "new_letters" and my idea would be the simple one following:
var counter = firebase.firestore().ref("new_letters").onSnapshot(snapshot => {
return snapshot.size
});
My problems are the following:
Im looking for a solution which is the least recource-consuming.