Rank 2: Process
Coming from Firebase, I have a hard time figuring out the database model for my App.
Collections I already have:
- store (eg. grocery store)
- profiles (public user profile)
- addresses (where store is located)
- reviews (store reviews)
Relations are simple:
- Store has one Address. Ideally, address is nested in Store (currently it's working on version 1.4 using one to one relationship)
- Store can have many reviews. Each review must have an author (Profile). Each profile can have many reviews for different stores. Each reviews contains information about store its referring to.
How would you implement that kind of relationships? Using new relationship attribute in 1.4, I have issues with receiving nested documents when I don't want them (eg. displaying list of stores always gives me an array of reviews, with nested profile, per each store in list)
Should I just keep an id of a document and fetch it manually? When to choose relationship and when do it manually via id?
Thanks in advance.