Question about Exercise Tracker - retrieving a full exercise log at api/exercise/log

So I’m trying to figure out how “/api/exercise/log” is supposed to work in:

4. I can retrieve a full exercise log of any user by getting /api/exercise/log with a parameter of userId(_id). Return will be the user object with added array log and count (total exercise count).

I added to a new user to the database, and the id for this is “rkfmRTSpm”

When I do:{rkfmRTSpm}”


I get “unknown userId”

but when I do

and search for “rkfmRTSpm”, it finds the associated user.

I am clearly missing something. Can someone please point out what it is?

Much appreciated.

You are missing the key for your query in the URL, try something like this:


and then use req.query._id or (depending on your choice) when querying the database.

1 Like

I still get “unknown userId”
is the example project given in the project description:

Try It works for me.

Alright thanks! - that seems to work

1 Like

Yes that is the solution. They should have made this more obvious though, a normal user would not be able to translate “/api/exercise/log?{userId}[&from][&to][&limit]” to what he actually needs to put in.

1 Like