title: Error "cannot read property of value null" when trying to use bcrypt.compare
body: <p>I am trying to use <code>bcrypt.compare</code> on my admin login route but I am getting &quot;cannot read property of value null&quot;</p>
  <p>This is my password page:</p>
  <pre class="lang-js prettyprint-override"><code>let passwordObject = await Password.findOne({
   subjectType: 1,
   status: 1,
   subjectId: adminId,
  });
  console.log('passowrd', passwordObject )
  let data = await bcrypt.compare(password, passwordObject.value)
  </code></pre>