title: How to Count Total Rows in MongoDB with NodeJS?
body: <p>I'm working to count total rows, in case the column name is nama_materi with condition = "HTML".</p>
  
  <p>Here's my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>getTotalListHTML: (req, res, next) =&gt; {
      modelsListMateris.find({nama_materi:'HTML'}, (err, result) =&gt; {
        if (result) res.send(result);
        else res.send(err);
      })
    },</code></pre>
  </div>
  </div>
  </p>
  
  <p>I expect to add method count() after find statement, but it's not working. Thank you for helping me!</p>