title: Node Js sequelize raw query to sequelize ORM
body: <p>I need to <code>sequelize</code> raw <code>query</code> change to <code>sequelize ORM</code></p>
  
  <p>This is my query </p>
  
  <pre><code>db.sequelize.query("SELECT count(*) as count FROM cubbersclosure WHERE CAST('"+ fromDate +"' as date) &lt;= toDate AND CAST('"+ toDate +"' as date) &gt;= fromDate", { type: sequelize.QueryTypes.SELECT}).then(closureData=&gt;{
      res.send(closureData);
  
  }).catch(error=&gt;{
      res.status(403).send({status: 'error', resCode:200, msg:'Internal Server Error...!', data:error});
  });
  </code></pre>
  
  <p>Change to like this</p>
  
  <pre><code>CubbersClosure.findAndCountAll({
      where:{
          // condtion here         
      }
  }).then(closureData=&gt;{        
      res.send(closureData);
  }).catch(error=&gt;{
      res.status(403).send({status: 'error', resCode:200, msg:'Internal Server Error...!', data:error});
  });
  </code></pre>