Using mongoose promises with async/await : <p>I'm trying to get the hang of using Mongoose promises with the async/await functionality of Node.js. When my function <code>printEmployees</code> is called I want to save the list of employees which are queried by the <code>orderEmployees</code> function. While, the <code>console.log</code> statement inside <code>orderEmployees</code> returns the expected query, the <code>console.log</code> inside of <code>printEmployees</code> returns <code>undefined</code>, suggesting that I'm not returning the promise correctly.</p>

<p>I'm new to promises so entirely possible that I'm not correctly understanding the paradigm... any help is much appreciated.</p>

<pre><code>  printEmployees: async(company) =&gt; {
    var employees = await self.orderEmployees(company);
    // SECOND CONSOLE.LOG
    console.log(employees);
  },

  orderEmployees: (companyID) =&gt; {
    User.find({company:companyID})
    .exec()
    .then((employees) =&gt; {
      // FIRST CONSOLE.LOG
      console.log(employees);
      return employees;
    })
    .catch((err) =&gt; {
      return 'error occured';
    });
  },
</code></pre>
