title: MongoDB Projection Query Output toArray in Javascript/Node.js
body: <p>I am using a query with a projection to retrieve only specific fields from a MongoDB collection. Is it required to output the results of such a query to an Array? I wasn't able to find any working example without this conversion to an array.</p>
  <pre><code> db.collection(&quot;collection&quot;).find({}, { projection: { Name : 1, Price : 1 } }).toArray( (err, result) =&gt; {
     if (result) {
       console.log(result)
     }
   })
  </code></pre>
  <p>However, by outputting the results to an Array, I am obtaining the result in the following format (a JSON formatted output within an array of 1):</p>
  <pre><code>[ {key1:value1, key2:value1}, {key1:value2, key2:value2}, ...]
  </code></pre>
  <p>I would like the results to be outputted as JSON.</p>