通过续集查询时:
where["tenant_id"] = tenant_id;
where[datecheck] = {
$gte: from,
$lte: to,
$ne: null
};
group = [ group_by + '_id' , "stage_type"];
attributes = [[group_by + '_id', 'id'], [group_by + '_name', 'group'], ["stage_type", 'type'], [ sequelize.literal('SUM(`stage_value`)'), 'count']];
Model.findAll({
attributes: attributes,
where: where,
group: group
});
我收到此错误:
数据类型错误:attr [0] .indexOf不是函数
at attribute.map.attr( sequelize / lib / dialects / abstract / query-generator.js:1244:28)
答案 0 :(得分:0)
我认为当查询中的id为null时会引发此错误。