title: PULL DATA (count) FROM MONGODB AND DISPLAY IT in a web app?
body: <p>I'm trying to pull the number of documents in mongodb db and display it in my Application home page... I found this code that it works well but returns the list of all documents (users List):</p>
  
  <pre><code>router.get('/userlist', function(req, res) {
      var db = req.db;
      var collection = db.get('usercollection');
      collection.find({},{},function(e,docs){
          res.render('userlist', {
              "userlist" : docs }); }); });
  </code></pre>
  
  <p>I don't understand the part function(e,docs)!
  I tried the following code to get the number of documents but it doesn't work:</p>
  
  <pre><code>router.get('/userlist', function(req, res) {
      var db = req.db;
      var collection = db.get('usercollection');
      collection.count({},{},function(e,docs){
          res.render('userlist', {
              "userlist" : count }); }); });
  </code></pre>
  
  <p>Thank you for help</p>