Exercise Tracker - Help

Hi

I have started doing the Exercise Tracker micro service, however, I am finding it extremely difficult to understand what the :_id parameter is.

It’s being used almost everywhere but I just cannot grasp it. What makes matters worse is that they demo project that FCC host does not work 100%.

Anyone able to shed some light?

Much appreciated!

MongoDB assigns an id to every document it stores, which is under the parameter “_id”.

Yes, 100%. However, is this the same _id parameter that’s used when posting and querying exercises?

the id can be anything you assign it, but its convenient you use the generic id which mongo assigns.
For example this requirement:

You can POST to /api/users with form data username to create a new user. The returned response will be an object with username and _id properties.

The user POST with data username. You create a document with that username in mongo. The document will automatically acquire a prop _id. You can then return that object in the response, containing the username and _id.

Thank you so much for clarity. I just wanted to bounce my understanding of the project requirements.

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