The return value of getAOLDataCount
is undefined. You're returning the aolCount
variable from within an anonymous function in your .then()
call and it's not being returned.
It's basically the same as this:
module.exports = {
getAOLDataCount: function () {
wd = new WeeklyData(sequelize, Sequelize.DataTypes);
wd.count({where: {week:201740, project: 8}}).then(function (aolCount) {
console.log(aolCount);
return aolCount;