mongoose findOne function return undefine
<p>I know we have lots of questions like this in here, but none of the answers seems to work on my code, take a look:</p>

<pre><code>establishment = mongoose.model('Establishment' , new Schema({
    //_id : Schema.Types.ObjectId,
    name : String,
    cnpj : String,
    description : String,
    address : String,
    products : [],
    isActive : {type: Boolean, default: true}
}));




app.get('/home',(req, res)=&gt;{
    var a = establishment.findOne({_id : "57d83a867d3ba20fcb657dc7" } , (err, estab)=&gt;{
        if(err){
            return err;
        }
        console.log("inside the function: "+estab.name);
        return estab
    });
    console.log("outside the function: "+a.name)
})
</code></pre>

<p>when any output is given inside the findOne() function, it all work out just fine, but when i return it, just says it's "undefined"</p>