Sequelize how to check if entry exists in database
<p>I need to check if entry with specific ID exists in the database using Sequelize in Node.js</p>

<pre><code>  function isIdUnique (id) {
    db.Profile.count({ where: { id: id } })
      .then(count =&gt; {
        if (count != 0) {
          return false;
        }
        return true;
      });
  }
</code></pre>

<p>I call this function in an if statement but the result is always undefined </p>

<pre><code>if(isIdUnique(id)){...}
</code></pre>