【发布时间】:2017-10-21 12:50:13
【问题描述】:
Student表中有一个Sage,我想用2017-Sage查询一个学生的出生年份,但是我不知道怎么做,我试过这样:
db.Student.findAll({
attributes: ['Sname','Ssex',[2017-Sequelize.col('Sage'),'Year of birth']],
where: {
Clno: {
$in: ['01311','10665']
}
}
})
但它来了错误:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: attr[0].indexOf is not a function
【问题讨论】:
标签: mysql node.js database sequelize.js