title: How to get all fields of a MongoDB document
body: <p>In application I write down in a collection of users documents with separate users. Each document is an object in which there is a name of the user and his category. Categories are an object. How can I take all recorded categories. I try to take them through find (), but there I need to specify the key-value. And I just need to specify the category field and take all the key-values ​​there. How can I get all categories of an individual user?
  I need to find them by key.</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-js lang-js prettyprint-override"><code>mongoClient.connect(function (err, client) {
    const db = client.db("expensesdb");
    const collection = db.collection("users");
  
    if (err) return console.log(err);
  
    collection
      .find({ name: "Bob"})
      .toArray(function (err, results) {
        console.log(results);
        client.close();
      });
  });</code></pre>
  </div>
  </div>
  </p>