Data Modeling and ERD Diagrams
Diagrams
- User data includes: ID, first name, last name, list of friends, email, password, link to picture, location, occupation, number of views, and impressions.
- Post data includes: user description of the post, whether they're friends with the post, user profile, image, number of likes, and comments.
Now organizing everything via different objects and relationships.
- Relationships include: friends, which can be an array of objects with ID, first name, last name, picture path, occupation, and location; picture path, which refers to the location of all images; and user ID, which refers to a specific user.
Note
it's generally better to use sub-documents rather than arrays of IDs, as sub-documents make it easier to access information and reduce the need for additional queries.