title: Return a value from sequelize query
body: <p>I'm new to sequelize. I'm using mysql as my database. I've a sequelize query which finds the email-id from the database. By using the result of this query, I got the ID of that row. Now I need to return this value. Can someone please help me how to do that.</p>
  
  <p>Here is my code. </p>
  
  <pre><code>var userId = getUserId(email_address);
  function getUserId(email_address) {
     models.users.findOne({
       where: {
         email: email_address
       }
     }).then(function(result) {
        if (result) {
          var applicantId = result.id;
          return applicantId;  // This is what I need to do
        } else {
          console.log("Could not find Email");
        }
     });
  }
  </code></pre>
  
  <p>Here I need to return the variable applicantId to the calling function.</p>