title: mongoose throws internal server error when ID doesn't exist
body: <p>mongoose <code>findOne</code> query throws <code>Interal Server Error (500)</code> when looking for a value that doesn't exists.<br />
  I'm pretty sure it should return <code>null</code> or empty array instead of throwing error.</p>
  <p><strong>Mongoose version: ^5.8.7</strong></p>
  <p>First attempt</p>
  <pre><code>router.get('/:myId', async(req, res, next) =&gt; {
    const myId = req.params.myId;
    
    await myDocument.findOne({ _id: myId }, (err, myData) =&gt; {
      if (!myData) {
        res.status(404).render('404');
      } else {
        res.render('myPage', myData);
      }
    }).exec()
  
  });
  </code></pre>
  <p>second attempt</p>
  <pre><code>router.get('/:myId', async(req, res, next) =&gt; {
    const myId = req.params.myId;
    const myData = myDocument.findOne({_id: myId}).exec();
    
    if (myData) {
      //render normal page
    }
    // render 404 page
  });
  </code></pre>
  <p>According to <a href="https://mongoosejs.com/docs/api.html#model_Model.findOne" rel="nofollow noreferrer">documentation</a>, this should NOT happen.</p>
  <blockquote>
  <p>Note: conditions is optional, and if conditions is null or undefined, mongoose will send an empty findOne command to MongoDB, which will return an arbitrary document. If you're querying by _id, use findById() instead.</p>
  </blockquote>
  <p>Also tried to use <code>findById()</code> and <code>find()</code>. All cases the same happens.<br />
  It works perfectly when I pass a valid ID parameter.<br />
  How to search for data without throwing http error in case Id doesn't exists in collection?</p>