Exercise Tracker (I can get an array of all users by getting api/exercise/users with the same info as when creating a user)

Tell us what’s happening:
one of my tests seem to fall even the result is correct for that API
Test case No 3 (I can get an array of all users by getting api/exercise/users with the same info as when creating a user.) is failing every time
Your code so far
```

app.get('/api/exercise/users', function (req, res) {
   ExerciseUser.find({}).select({ __v: 0 }).exec((err, data) => {
   console.log('user', data);

  if (err) {
    console.error(err);
    return res.json({ error: err })
  }
  if (data && data.length) {
    res.json({ data })
  } else {
    res.send('no user found');
  }
})

})


**Your browser information:**

User Agent is: <code>Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36</code>.

**Challenge:** Exercise Tracker

**Link to the challenge:**
https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/exercise-tracker
1 Like

Hello and welcome to the FCC community~!

Could you provide us with a link to your project?

you may try only with data without {} and if it does not work you follow this syntax

yourDB.find({}).toArray((err, data)=>{
// here data will give you an array of all the users
})