title: Empty result when querying MongoDB database in Node.JS
body: <p>I appologise for the horrendous title for this submission but I have been tearing my hair out for at least 8 hours now trying to solve this.</p>
  
  <p>I initially took some guidance from sova's result on Express displaying mongodb documents in Jade <a href="https://stackoverflow.com/questions/39298618/express-displaying-mongodb-documents-in-jade">Express displaying mongodb documents in Jade</a></p>
  
  <p>However whenever I try and do the query it fails.</p>
  
  <p>my index.js code is this.</p>
  
  <pre><code>app.get('/test', function (req, res) {
  var MongoClient = require('mongodb').MongoClient
  var url = 'mongodb://localhost/quizmaster';
  
  var results_from_mongo = [];
  
  MongoClient.connect(url, function (err, db) {
      var str = db.collection('qmquestions').find();
      str.each(function (err, doc) {
              //console.log(doc);
              results_from_mongo.push(doc);
              console.log(results_from_mongo) //Push result onto results_array
      });
  
      //now we have a results array filled like this:
      // results_from_mongo = ["some string", "some string", "some string"]
     //so let's pass them to the jade file to render them.
    res.render('test', {results_from_mongo : results_from_mongo });
    });
  });
  </code></pre>
  
  <p>My test.jade code is this </p>
  
  <pre><code>block content
  h1= title
  h2= "results from mongo:"
  select
    each results_from_mongos, i in results_from_mongo
      option(value=i) #{results_from_mongos}
  </code></pre>
  
  <p>I have even tried the pug variation of this (test.jade)</p>
  
  <pre><code>        table
              thead
                  tr
                      th Question name
                      th Question
                      th Answer
              tbody
                  each results_from_mongo, i in results
                      tr
                          td= results_from_mongo.questionTitle
                          td= results_from_mongo.question
                          td= results_from_mongo.answer
  </code></pre>
  
  <p>The db.collections.find direct from MongoDB result is </p>
  
  <pre><code>{ "_id" : ObjectId("58af574c4fef02081c32da2f"), "question" : { "questionTitle" : "Test", "question" : "Test", "answer" : "Test" } }
  </code></pre>
  
  <p>I have just tried so many different ways of trying to get it but all it equals is an empty result no matter what I do if anybody could help me out on this I would be greatly appreciated as I am just ripping my hair out on this and I feel it must be something so simple which I am missing. If anymore code is needed then I will edit the post with the code asked for.</p>