Remember, when you structure your data in Cloud Firestore, you have a few different options:
- Multiple collections
- Subcollections within documents
Consider the advantages of each option as they relate to your use case. A few example structures for hierarchical data are outlined in this guide.
Nested data in documents
You can nest complex objects like arrays or maps within documents.
You can create collections within documents when you have data that might expand over time.
Create collections at the root level of your database to organize disparate data sets.