Back End Development and APIs Projects - Exercise Tracker

Describe your issue in detail here:

I’m failing the last five tests above the last test where the log output is in a specific format. When I do this manually with personal tests, the response output matches the outline given in the challenge but also it matches the output given in the freecodecamp rocks example. I do not know why the test is failing, I don’t get an error on my console but on fcc the output is:
[TypeError: Cannot read properties of undefined (reading ‘description’)]
[TypeError: Cannot read properties of undefined (reading ‘duration’)]
[TypeError: Cannot read properties of undefined (reading ‘date’)]
which would align with the tests. Can anyone provide advice?

solution: boilerplate-project-exercisetracker - Replit

Your browser information:

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

Challenge: Back End Development and APIs Projects - Exercise Tracker

Link to the challenge:

Try putting your variables in try catch blocks, or an if statement of some kind. The variables are trying to be read before they are given their values.

I realized none of my code actually gets show, heres what I did to organize the logs (Probably a better way sure but this is mine ;-:wink:

let logs = [];
    for (const lg in getUser[0].log) {
      logs.push(getUser[0].log[lg][0]);
    }
    let filtered = logs.filter((ld) => (new Date(ld.date) > (new Date(from))) && ((new Date(ld.date)) < (new Date(to))));
    filtered = filtered.slice(0, limit);

when I log it out, the log matches the output. My method of storing it on atlas ls this

const exSchema = new Schema({
  username: String,
  count: Number,
  log: [Schema.Types.Mixed]
});

where inside log is:
log: [{
description: String data,
duration: Number data,
date: date data
}]
Attached a picture to how its stored as well.
But regardless, I’m able to filter it out and display it but it still fails.
Screenshot 2023-10-06 153254