title: Issue with fetching value from mongodb using mongoose it always returns [ ]
body: <p>I'm trying to learn mongoose with nodejs and created a following node function as below where in I'm receiving the email ID from the Angular application and based on the EmailId trying to find the records in MongoDb:</p>
  <pre><code>const express = require('express');
  const mongoose = require('mongoose');
  var bodyParser= require(&quot;body-parser&quot;);
  const port = 3000;
  const app = express();
  
  
  //setting up bodyParser middleWare
  app.use(bodyParser.urlencoded({&quot;extended&quot;:true}))
  app.use(bodyParser.json());
  
  //setting mongoose connection to local mongoDb
  mongoose.connect(&quot;mongodb://127.0.0.1/userDetails&quot;,{useNewUrlParser:true,useUnifiedTopology:true})
  const db = mongoose.connection;
  
  var userSchema =  new mongoose.Schema({
      email:{type:String},
      userId:{ type: String, required: true },
      password:{ type: String, required: true }
  });
  
  
  var users = mongoose.model('User', userSchema); 
  
  //error handler middleWare
  app.use(function(err, req, res, next) {
    console.error(err.stack)
    res.status(500).send('Something broke!')
  });
  
  app.post(&quot;/login&quot;,async(req,res,next)=&gt;{
      try {
       
        await  users.find({ email:&quot;xyz@gmail.com&quot;}).exec(function (err, docs) { 
      if (err){ 
          console.log(err); 
      } 
      else{ 
          console.log(&quot;First function call : &quot;, docs); 
      } 
  })
      }
      catch(err){
          next(err);
      }
  })
  
  app.listen(port,()=&gt;{console.log(&quot;server started&quot;)});
  </code></pre>
  <p>The above code shows no error, but the output is always First function call :  [].My mongodb collection is as follows</p>
  <pre><code>db.User.insertMany([
     { email: &quot;xyz@gmail.com&quot;, userId:1,password : &quot;123@124&quot; },
     { email: &quot;abc@yahoo.com&quot;,userId:2,password : &quot;123@125&quot;},
     { email: &quot;lmn@outlook.com&quot;, userId:3,password : &quot;123@126&quot;}
  ])
  
  
  db.User.find({ email: &quot;xyz@gmail.com&quot;});
  </code></pre>
  <p>Where is that I'm going wrong ,what should be the approach to get the data?</p>