How did you model the database for the Challenge: Exercise Tracker

Don’t wanna start with the left foot! So I was thinkin about making two collections, one for the users, and another collection with the list of exercises and it’s fields. Then make a correlation like one to many through the id, which is stored on the user document, and on each exercise document.

How did you guys model the data? Any suggestion?

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36.

Challenge: Exercise Tracker

Link to the challenge:

Sounds like you’ve some experience with SQL relational databases, but since you’re working with Mongo (noSQL), you don’t really have to worry too much about it. You can complete the challenge with one collection “users”, where each user has a field “exercises” of type Array (or however you want to name it).

1 Like

Thanks @jsdisco , I’ve never used relational databases. I like your suggestion and I’ll apply it, it makes things easier! :grin:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.