I am doing a login system in NodeJS with a Mongo database, so I try to look in my collection if the user exist. For my tests, I have a user registered, and I'm trying to find him.

My problem is that findOne method return the full user' data as I wish, but in the error parameter, not in the results parameter, and I have no logs to understand why...

Did somebody know why ?

Here is my code:

```
app.post('/login', (req, res) =>{
    console.log(req.body.identifier);
    console.log(req.body.password);

    client.connect().then(() => {

        let newUser = {identifier : req.body.identifier}
        res.redirect(req.body.locator)

        return client.db(`${process.env.MONGODB}`).collection(`${process.env.MONGOCOLLECTION}`).findOne(newUser).then((err, res) => {
            if (err){
                console.log("ERROR: "+err.role)
                throw err;

            }else if(res){
                console.log("user found");
                console.log(res.role)
            }
      })
    }).catch( e => { console.error(e) }).then(() => {
        console.log("--------------------------------");
    })
})

```

And this is what I got :

```
mail@mail.com
azer
ERROR: USER
{
  _id: 6087d850ad9f6f2e0ce97045,
  identifier: 'mail@mail.com',
  password: '7657d9148a5720dcf4eb4b8bc998498e5d701ce7beb302f398c3d5c0dbd0f857f824b7bfaa45c2a8aba4f85c4ab8b12c99bfb28328e72a89afe11326dc1d3a38349c1c36790a24c910528ada34529e6736ae45f0e5d87ce6b109207e21169bc9b4056fff',
  role: 'USER',
  sign_up: 2021-04-27T09:24:32.616Z,
  name: 'Test',
  firstName: 'Test'
}
--------------------------------

```