Reputation: 6766
Type of App to give context: An app that enables wedding bands to create a profile. Part of this profile will be to enter different dates with locations (Events)and return them in a list view. I have a Firestore collection called userData
. The collection is made up of documents IDs
(Firebase User ids) generated during sign in. These documents contain fields, mainly Strings
and arrays
for things like a header image.I'm thinking of creating a class called Events
with member variables date
and venue
. I'm wondering how I should structure Firestore to allow the Events be queried and returned in a listView. I've looked at sub collections
where the UserData would be a parent but I'm not sure is this possible? Or maybe creating a collection at the root called Events but not sure how'd I'd connect the different bands to their Events
. Here is a screen shot of Firestore. Each document is a band.
Upvotes: 0
Views: 1130
Reputation: 317372
You can either:
It's totally up to you to choose. It will depend on the kinds of queries you want to make. Note that if you go with #2, you will not be able to query for events across bands (at least not until Firestore supports collection group queries which it does not today).
Upvotes: 2