DEV Community

Zach
Zach

Posted on

MVP Project

It's the end of day 1 on the MVP project. Our assignment is to complete a full-stack mini-app in two working days. I like the energy of a project like this: bang-bang, what can you think up and execute on with a super quick turnaround.

When the assignment was introduced, I asked our Tech Mentor whether I could just continue on with my side-project and kill two birds with one stone. He suggested an alternative. Make something that could serve as a stand-alone version of the feature I'd like to create -- something that I could later improve upon in the full project. That's what I intend to do.

What feature will I build?

I've started work on the Question/Answers section of the blog project. You can think of it as a Stack Overflow wannabe.

I had to do a little re-reading on Mongo schema design and two options fell under the scope of the one-to-many relationship that describes the one-question-to-many-answers dynamic.

The two options:

  • Embed the answers in each question...or
  • Reference the child answer in each parent

I decided to do the latter.

It requires more work if you want to reassign the question to a different asker - but when would I need that?

More commonly, I'd need to relate the answer with the answer-er - like to list the answers they've provided in their profile. In this case, it'd be a lot easier to look up the answer by its author than to go through the every question for every answer, and then search by user.

In my next post I'll show how I implement that design in a schema that contains ObjectID references.

Top comments (1)

Collapse
 
amandee54426428 profile image
Amandeep Singh

You are doing vey well, keep doing and Stay Motivated.
Have A Wonderful Day

Monday Motivation

Yt Mp3 Converter

Lizzo Weight Loss