title: How to get nesting from an object
body: <p>I add object with categories in a DB. It shows the price and date of addition. How can I print the date to the console? Now, I have in the console: [ [ { cost: '50$', date: [Object] } ] ]. And I need to take what is in date. How can i do this?</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>// my obj
  
  сategories: {
      products: {
        cost: "50$",
        date: {
          day: `11`,
          month: `11`,
          year: `11`,
        },
      },
    },
  
    // get date
  
    mongoClient.connect(function(err, client) {
      const db = client.db("expensesdb");
      const collection = db.collection("users");
  
      if (err) return console.log(err);
  
      collection.find({
        name: "Tom"
      }).toArray(function(err, results) {
        let res = results.map((user) =&gt; user.сategories.map((cat) =&gt; cat.products));
        console.log(res);
        client.close();
      });
    });</code></pre>
  </div>
  </div>
  </p>