I am making an app and I am trying to figure out why using nested collections is frowned upon by Firestore. The app is a expense tracking app and the data is only relevant to the logged in user and that user never cares about any other user. There are two ways that I have found to structure the data. One uses a few more levels of nesting than the other. The following structures mean:
collectionName: valueNames
subcollectionName: valueName
Structure 1 (Not as nested):
user:
month: totalSpent, startDate, endDate
transactions: categoryId, amount, timestamp
categories: monthId, name, totalSpent
Structure 2 (More nested):
user:
month: totalSpent, name, startDate, endDate
categories: name, totalSpent
transactions: categoryName, amount, timestamp
Can someone tell me the advantages of structure 1 as opposed to structure 2? Considering structure 2 seems to be easier to query and I do not have to keep track of multiple id's I can just get the sub collection. This would also make it easier to track previous months to show the user later when they want to analyze their spending.