title: User.find() related error
body: <h2>Error: data and hash arguments required</h2>
  
  <p>Of course this question has been asked already. But my problem is different. I am trying to login with <strong>username - lucky</strong> and <strong>password - mani</strong> which is already registered into the mongodb. But my project is not working properly. Here its <strong>userroutes.js</strong> is given below.</p>
  
  <pre><code>router.post('/login',(request,response)=&gt;{
  console.log(request.body.form_username);//lucky
  console.log(request.body.form_password)//mani
  userOperation.login(response,request);});
  </code></pre>
  
  <p>Here I am getting username and password on the console.
  Now it's calling <strong>userOperation.login</strong>. Here is the <strong>usercrud.js</strong> in which <strong>userOperation.login</strong> is implemented.
  `</p>
  
  <pre><code>var User = require("../../schema/user/userschema");
  
  var bcrypt = require('bcrypt');
  
  const userOperation={
  
      login(res,request){
         console.log(request.body.form_username);//lucky
         console.log(request.body.form_password);//mani
  
                User.findOne({ userid:request.body.form_username}, function (err, user) {
                  console.log(request.body.form_username);//undefined....why???
                  console.log(request.body.form_password);//undefined....why???
                  if (err) {
  
                       return done(err); }
                  if (!user) {
  
                    return done(null, false, { message: 'no user found' });
                  }
                  if(user){
                  bcrypt.compare(request.body.form_username, user.password, function(err, res) {
  
                      if (err)
                      throw err;
                      if(!res) {
  
                        console.log('Ooops!. Wrong Pass!');
                        return done(null, false, req.flash('loginMessage', 'Oops! Wrong password.')); // create the loginMessage and save it to session as flashdata
                      }
                      if(res){
                          // request.session.userid = request.body.form_username;
                          // request.sesssion.password = request.body.form_password;
                      response.send("Login Done");
                      }
                    });
                  }
                });
              },
          }`
  </code></pre>
  
  <p>Still username and password is being printed properly but here <strong>problems starts--</strong>
  When I am trying to print username and password inside the <strong>User.find()</strong>, it's printing <strong>undefind</strong>. <strong>why??????</strong>
  This is why I am getting the <strong>Error: data and hash arguments required</strong>
  Because I am trying to give an undefined argument into the <strong>bcrypt.compare()</strong></p>
  
  <p><a href="https://i.stack.imgur.com/YFWgI.png" rel="nofollow noreferrer">this is link of screenshot of the server console</a></p>
  
  <p>My second question is <strong>why I am getting undefined four times after the server starts??</strong>
  Here is the userschema.js</p>
  
  <p><code>var mongoose = require("../../connection");
  var Schema = mongoose.Schema;
  var userSchema = new Schema({userid:String,
                               password:String<br>
                              });
  var User = mongoose.model("onlineusers",userSchema);
  module.exports = User;</code></p>