title: Passing two query results into a response
body: <p>I have a query that fetches the top 5 people for a leaderboard.  In robomongo this query works fine.</p>
  
  <p>When I do something like</p>
  
  <pre><code>var leaderboard = User.find({points: {$exists: true}}, {
      "firstname": 1,
      "lastname": 1,
      "points": 1
  }).sort({points : -1}).limit(5)
   console.log('leaderboard');
  </code></pre>
  
  <p>I get a lot of meaningless json with [object] almost everywhere.</p>
  
  <p>How would I execute this query for use with mongoose + express so I can pass through to the view as an array of</p>
  
  <pre><code>firstname, lastname, points 
  </code></pre>
  
  <p>So I can loop it through in the view?</p>
  
  <p>My complete code is </p>
  
  <pre><code>app.get('/dashboard', function(req, res){
  
    if (req.user) {
      // logged in
  
     User.find({}, function(err, docs) {
        // console.log(docs);
    });
  
      // Get total points after submit
    var leaderboard = User.find({points: {$exists: true}}, {
        "firstname": 1,
        "lastname": 1,
        "points": 1
    }).sort({points : -1}).limit(5).toArray();
    console.log(leaderboard);
  
    User.find({
        points: {
            $exists: true
        }
    }, function(err, docs) {
        if(err){
            console.log(err);
            //do error handling
        }
        //if no error, get the count and render it
        var count = 0;
        for (var i = 0; i &lt; docs.length; i++) {
            count += docs[i].points;
        }
        var totalpoints = count;
  
        res.render('dashboard', {
        title: 'Dashboard',
        user: req.user,
        totalpoints: totalpoints
        });
    });
  
    } else {
      // not logged in
      return res.redirect('/login');
      }
  
  });
  </code></pre>