我正在尝试通过sequelize从数据库中输出所有对象列表,如下所示,并希望在我在where子句中添加id时对数据进行整理。
exports.getStaticCompanies = function () {
return Company.findAll({
where: {
id: [46128, 2865, 49569, 1488, 45600, 61991, 1418, 61919, 53326, 61680]
},
attributes: ['id', 'logo_version', 'logo_content_type', 'name', 'updated_at']
});
};
但是问题是渲染后,所有数据按如下进行整理。
46128, 53326, 2865, 1488, 45600, 61680, 49569, 1418, ....
正如我发现的那样,它既没有按ID也没有按名称排序。请帮我解决。
46128, 2865, 49569, 1488, 45600, 61991, 1418, 61919, 53326, 61680
。