title: Pass value in Schema.pre('update')
body: <p>my update function is</p>
  
  <pre><code> User.update({_id: data._id}, {$set: {password: req.body.newpassword}})
          .then(data =&gt; {
            res.json(data)
          })
          .catch(err =&gt; {
            res.status(400).json(err);
          });
  </code></pre>
  
  <p>and my <code>pre</code> middleware is define as</p>
  
  <pre><code>UserSchema.pre('update',function (next) {
  
   console.log(this.password)  //it shows undefined
  
  });
  </code></pre>
  
  <p>i don't know how to use this so that i can pass my <code>password</code> field in <code>pre</code> middleware which i further want to hashed</p>
  
  <p>thanx.</p>